Rogue Wave Views 5.6 |
Rogue Wave Views |
Rogue Wave Views Documentation Home |
Manages the storage of a pointer, providing a limited garbage-collection facility, possibly sharing that management with other objects. More...
#include <ilog/shrptr.h>
Public Member Functions | |
IlSharedPtr (T *ptr=0) | |
Constructor. More... | |
IlSharedPtr (const IlSharedPtr< T > &other) | |
Copy constructor. More... | |
~IlSharedPtr () | |
Destructor. More... | |
T * | get () const |
Access to the encapsulated pointer. More... | |
IlSharedPtr< T > & | operator= (const IlSharedPtr< T > &other) |
Assignment operator. More... | |
Manages the storage of a pointer, providing a limited garbage-collection facility, possibly sharing that management with other objects.
Library: ilog
This template class is largely inspired from the share_ptr
template class provided in the ISO C++ Standard Template Library. It is replicated here (and substantially simplified) because of portability limitations. Only crucial methods are implemented.
IlSharedPtr< T >::IlSharedPtr | ( | T * | ptr = 0 | ) |
Constructor.
Creates an initial reference on the pointer.
IlSharedPtr< T >::IlSharedPtr | ( | const IlSharedPtr< T > & | other | ) |
Copy constructor.
Creates an additional reference on the encapsulated pointer.
IlSharedPtr< T >::~IlSharedPtr | ( | ) |
Destructor.
If no other smart pointer is sharing the encapsulated pointer, then it is deleted.
T* IlSharedPtr< T >::get | ( | ) | const |
Access to the encapsulated pointer.
IlSharedPtr<T>& IlSharedPtr< T >::operator= | ( | const IlSharedPtr< T > & | other | ) |
Assignment operator.
other | The shared pointer to be copied. |
© Copyright 2012, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.