Factbites
 Where results make sense
About us   |   Why use us?   |   Reviews   |   PR   |   Contact us  

Topic: Smart pointer


Related Topics

In the News (Tue 8 Dec 09)

  
  Smart Pointer C++ Interface Primer
The Smart Pointer C++ Interface presents the NAO class library as a C++ class library.
Some implemented classes have been given thier own smart pointer interfaces, and these smart classes have constructors which correspond to the constructors of the class that they represent.
The trailing zero is important, since is tells the smart Manifold that the pointer is not being copied.
www.research.ibm.com /nao/Primer/smartPtrInterfacePrimer.html   (430 words)

  
  Pointer - Wikipedia, the free encyclopedia
Pointers are so commonly used as references that sometimes people use the word "pointer" to refer to references in general; however, if you are seeking general information on a small piece of data used to find an object, see reference (computer science).
Pointer arithmetic is unrestricted; adding or subtracting from a pointer moves it by a multiple of the size of the datatype it points to.
Pointer arithmetic is unrestricted; adding or subtracting from a pointer moves it by that number of bytes in either direction, but using the Inc or Dec standard procedures on it moves it by the size of the datatype it is declared to point to.
en.wikipedia.org /wiki/Pointer   (2627 words)

  
 Smart pointer - Wikipedia, the free encyclopedia
A smart pointer is an abstract data type that simulates a pointer while providing additional features, such as automatic garbage collection or bounds checking.
Pointer usage is a major source of bugs: the constant allocation, deallocation and referencing that must be performed by a program written using pointers makes it very likely that some memory leaks will occur.
Smart pointers try to prevent memory leaks by making the resource deallocation automatic: when the pointer to an object (or the last in a series of pointers) is destroyed, for example because it goes out of scope, the pointed object is destroyed too.
en.wikipedia.org /wiki/Smart_pointer   (368 words)

  
 [No title]   (Site not responding. Last check: 2007-10-19)
The pointer is shifted up by 1 to point to the next element of the array, provided it is not already pointing at the last element of the array.
The pointer is shifted down by 1 to point to the preceding element of the array, provided it is not already pointing at the first element of the array.
A new array pointer is created from the implied instance and then is shifted to point to a different element of the array, provided that the element is still within the bounds of the array.
www.ugcs.caltech.edu /~barqs/cs47/hw6/smarray.h   (1719 words)

  
 MFC: Smart Pointers and Multithreading
The key is to remember is the reference is held with the smart pointer, not with the thread itself.
I also was able to get the syntax of using the smart pointer to be consistent with normal pointer syntax for every case except for casting to a derived class.
MeefSmartPointer ptr; // MeefSmartPointer is a smart pointer to
www.experts-exchange.com /Programming/Programming_Languages/MFC/Q_10026928.html   (1151 words)

  
 Smart Pointer Timings
The initial allocation time for the contained pointer is not included, although the time for it's deallocation is. The contained pointer pointed to a trivial class, but for the inclusion of an intrusive reference count for the benefit of the intrusive counted shared pointer.
An estimate of the pure smart pointer operation time 'overhead' can be obtained by subtracting the dumb or raw figure from the smart pointer time of interest.
Smart pointers were used to fill standard containers which were then sorted.
www.boost.org /libs/smart_ptr/smarttests.htm   (938 words)

  
 Tutorial 10: Writing A Signal Processing Block for GNU Radio -- Part I
Smart pointers are particularly useful in the face of exceptions as they ensure proper destruction of dynamically allocated objects.
Conceptually, smart pointers are seen as owning the object pointed to, and thus responsible for deletion of the object when it is no longer needed.
These smart pointer class templates have a template parameter, T, which specifies the type of the object pointed to by the smart pointer.
www.nd.edu /~jnl/sdr/docs/tutorials/10.html   (2961 words)

  
 Smart Pointers   (Site not responding. Last check: 2007-10-19)
Smart pointers have been the subject of hecatombs of code written and rivers of ink consumed by programmers and writers around the world.
This chapter discusses smart pointers, from their simplest aspects to their most complex ones and from the most obvious errors in implementing them to the subtlest ones—some of which also happen to be the most gruesome.
In addition to sporting pointer syntax and semantics, smart pointers often perform useful tasks—such as memory management or locking—under the covers, thus freeing the application from carefully managing the lifetime of pointed-to objects.
www.informit.com /content/index.asp?product_id={7CBDD5B1-129D-427A-9C36-9C506D3DFABA}   (538 words)

  
 Smart Pointer Support
A smart pointer for "reference counted" objects is able to greatly simplify the programming tasks to maintain accurate reference counts.
The smart pointers described here are a very thin layer over regular pointers and if adopted correctly will eliminate virtually all leaks due to sloppy programming as well as provide exception safety.
The pointers PtrView and PtrDelegate are "policy" pointers indicating the intention to pass along the obligation to the recipient to decrement the reference count.
austria.sourceforge.net /dox/html/group__SmartPointerTrio.html   (1257 words)

  
 ANSI Degree College Mardan :: Digital Library - Smart Pointers   (Site not responding. Last check: 2007-10-19)
A smart pointer is a C++ class for wrapping "dumb" pointers.
This operator is the workhorse of any smart pointer class, and overloading the pointer operator is what turns a regular class into a smart pointer class.
Using smart pointers is similar to using the regular built-in C++ pointers.
www.ansi.edu.pk /library/WSLP/book1/html/ch03d.htm   (800 words)

  
 Smart Pointer
Smart pointers are usually used to automatically manage the lifetime of the object that they point to using the ResourceAcquisitionIsInitialization idiom.
Thus, smart pointers can be "chained" by returning temporary smart pointers that do clever things in their constructor or destructor.
Smart pointers should also implement the * operator to return a reference to the pointee, in the same manner as built in pointers.
www.c2.com /cgi/wiki?SmartPointer   (643 words)

  
 Smart Pointers: They're Smart, but They're Not Pointers   (Site not responding. Last check: 2007-10-19)
The ideal is for client code not to care whether it is using raw pointers or smart pointers.
For example, if a code typedef selects whether raw or smart pointers are used throughout the program, changing the value of the code typedef should not introduce syntax errors.
This paper presents the desired behavior of smart pointers in terms of the semantics of raw pointers that the smart pointers try to emulate.
www-sor.inria.fr /publi/SPC++_usenixC++92.html   (343 words)

  
 Phrog Tutorial - Smart Pointers   (Site not responding. Last check: 2007-10-19)
With smart pointers, we can't use a typecasting, because we don't have a reference to the object.
In general it is not allowed to assign a regular pointer to a smart pointer, except for newly created objects (this is not a technical problem but rather a safety precaution to prevent pointing to the same object by both a regular pointer and a smart pointer).
There are situations when smart pointers are unnecessary, for example, nodes in a graph need not be smart pointed, as they will be removed when the graph is deallocated.
ai.stanford.edu /~frog/tutorial-session1a.html   (413 words)

  
 Dev Source: Smart Pointers in C++   (Site not responding. Last check: 2007-10-19)
A pointer that you use to iterate in a buffer also has value semantics—you initialize it to point to the beginning of the buffer, and you bump it until you reach the end.
Smart pointers can figure out how ownership evolves, and their destructors can release the memory according to a well-defined strategy.
Some smart pointers transfer ownership automatically: After you copy a smart pointer to an object, the source smart pointer becomes null, and the destination points to (and holds ownership of) the object.
www.findarticles.com /p/articles/mi_zddvs/is_200407/ai_ziff130811   (1276 words)

  
 flipcode - COM Smart Pointer   (Site not responding. Last check: 2007-10-19)
It is basically a stripped-down smart pointer for objects that reference count using COM interfaces.
In some cases, the function you are passing a smart pointer to doesn't store the pointer anywhere, and is finished using it by the time it returns.
I suppose one way around this is to add a casting operator to the smart pointer class, to cast it back to a standard pointer without performing an AddRef on it, and have these simple functions take a normal pointer instead.
www.flipcode.com /cgi-bin/msg.cgi?showThread=COTD-COMSmartPointer&forum=cotd&id=11   (1027 words)

  
 Smart Pointer Thread Safety
You can pass a smart pointer from one thread to another, and the two threads are free to use their smart pointers just as they were native pointers.
The first is to have a "strong" smart pointer in one thread, and a weak pointer in another.
When we say that a smart pointer is thread-safe, we mean that it doesn't get in the way of accessing a shared resource, and that different threads that own smart pointers to an object are free to do with them whatever they like.
www.jelovic.com /articles/smart_pointer_thread_safety.htm   (438 words)

  
 [No title]
The smart pointer class is used to point at instances of objects and acts like a standard pointer.
It asserts that implied instance smart pointer is not NULL and then returns the pointer data member (to have the -> operator applied to it).
A copy is made of the object pointed to by the passed smart pointer, and the instance smart pointer is made to point at that copy.
www.cs.caltech.edu /~yrliu/cs47/hw6/arrayptr.h   (477 words)

  
 Reference Counted Smart Pointers
When a smart pointer is destructed, as when a member variable's owning object is destructed, or a value goes out of scope, or an allocated smart pointer is deleted, the reference count is decremented.
Other smart pointers use atomic operations to manipulate their reference count so they can be used in a multithreaded way.
Smart pointers that use the processor's atomic operations enable code to be very fast on symmetric multiprocessing systems, and very responsive even on machines with a single CPU.
www.goingware.com /tips/parameters/refcount.html   (1762 words)

  
 Smart Pointers - What, Why, Which?
A common pitfall of regular pointers is the dangling pointer: a pointer that points to an object that is already deleted.
Smart pointers can be used to make more efficient use of available memory and to shorten allocation and deallocation time.
Although it is possible to implement optimized allocation schemes using class-specific new and delete operators, smart pointers give you the freedom to choose whether to use the optimized scheme for each object, instead of having the scheme set for all objects of a class.
ootips.org /yonat/4dev/smart-pointers.html   (1902 words)

  
 kbAlertz: (242527) - If a COM object has a method that returns an interface pointer (retval), and #import is used to ...
If a COM object has a method that returns an interface pointer (retval), and #import is used to generate a wrapper for the object, a smart pointer is returned.
If a raw pointer is used for the assignment, an access violation may occur on the first attempt to use the interface.
Smart pointers are implemented in the _com_ptr_t class, and documented in the Reference section of the Visual C++ documentation, under C/C++ Language and C++ Libraries\C++ Language Reference\Compiler COM Support Classes.
www.kbalertz.com /kb_242527.aspx   (970 words)

  
 Smart Pointers
Smart pointers are objects which store pointers to dynamically allocated (heap) objects.
A page on compatibility with older versions of the Boost smart pointer library describes some of the changes since earlier versions of the smart pointer implementation.
A page on smart pointer timings will be of interest to those curious about performance issues.
www.boost.org /libs/smart_ptr/smart_ptr.htm   (1086 words)

  
 Untitled Document
This was done at run-time; pointers started out in "manual" (non reference-counted) mode and switched to "automatic" (reference-counted) mode when assigned to a reference-counted pointer.
When you pass a regular pointer to this object as argument to a function, you really need to be certain that the function implementation will not assign this pointer to a smart-pointer.
The bad news is that the fact that a function assigns a pointer argument to a smart-pointer does not necessarily appear in the function prototype.
www.animats.com /papers/languages/relatedwork.html   (539 words)

  
 Using ClanLib's smart pointers - ClanLib Game SDK
Smart pointers can be used as members of classes and work fine with compiler-supplied destructors, default constructors, copy constructors, and copy assignment operators.
To make your classes usable in the other two ClanLib smart pointer types, it's important that the classes you use in the smart pointers descend (directly or indirectly) from CL_Clonable, and implement a very specific clone() method at the start of their definitions.
When using a smart pointer as a pointer-to-implementation, it's often useful to have the pointer automatically cast dereferences to some type that has only been forward declared.
www.clanlib.org /docs/clanlib-0.8.0/Overview/pointers.html   (1032 words)

  
 CodeGuru: Smart Pointer (with Object Level Thread Synchronization '& Reference Counting Garbage Collection)   (Site not responding. Last check: 2007-10-19)
Passing a SmartPtr object as function parameter or function result is as efficient as passing an integer value or regular pointer - details.
The behaviour of the pointer depends on the underlying representation object.
So, no matter what is the intention of the holder pointer (in the example above "c" is a synchronization pointer) the pointer behaviour depends on the type of the representation object creator.
www.codeguru.com /Cpp/Cpp/cpp_mfc/pointers/article.php/c829   (1682 words)

  
 Smart pointer templates in C++
This means that the ownership of the pointer is held by the template class instance, so if we pass a pointer to an already-existing instance, we have to be sure not to delete it.
We'll start with a variation on the reference-counted template, using a pointer to the embedded instance of the parameter class, initialised from a pointer passed to the constructor.
This pointer is used to reference an integer holding the reference count, which means it can be shared between all references to the wrapped object.
www.davethehat.com /articles/smartp.htm   (3662 words)

  
 class PSmartPointer   (Site not responding. Last check: 2007-10-19)
Destroy the smart pointer and decrement the reference count on the object being pointed to.
This is identical to determining the relative rank of the integer values represented by the memory pointers.
Determine if the smart pointer has been set to point to an actual object instance.
www.openh323.org /docs/pwlib/PSmartPointer.html   (279 words)

  
 Smart pointers
A smart pointer is in itself a class which can be used like a pointer variable.
In the following example smart pointers are used to handle the use of Ivf++ classes.
When the method is completed the smart pointers will automatically dereference and delete the Ivf++ objects in the order shown in comments in the code below.
www.gorkon.byggmek.lth.se /ivfweb/documentation/usersguide/latex/node9.html   (202 words)

  
 A Smart Pointer Capable of Object Level Thread Synchronization and Reference Counting Garbage Collection - The Code ...
This causes that you don't have to inherit your classes from special base one to be able to use SmartPtr as a pointer.
The behaviour of the pointer depends on the underlying representation object.
So, no matter what is the intention of the holder pointer (in the example above "c" is a synchronization pointer) the pointer behaviour depends on the type of the representation object creator.
www.codeproject.com /cpp/smartptr.asp   (1896 words)

  
 Using auto_ptr Effectively
Think of the Standard C++ auto_ptr as the Ford Escort of smart pointers: A simple general-purpose smart pointer that doesn't have all the gizmos and luxuries of special-purpose or high-performance smart pointers, but that does many common things well and is perfectly suitable for regular daily use.
Because this smart pointer is simply used as an automatic object (that is, one that's destroyed automatically when it goes out of scope), it's reasonably called an "auto" pointer:
After the copy, only the target auto_ptr owns the pointer and will delete it in due time, while the source is set back to a null state and can no longer be used to refer to the owned object.
www.gotw.ca /publications/using_auto_ptr_effectively.htm   (2252 words)

Try your search on: Qwika (all wikis)

Factbites
  About us   |   Why use us?   |   Reviews   |   Press   |   Contact us  
Copyright © 2005-2007 www.factbites.com Usage implies agreement with terms.