gatb.core-API-0.0.0
|
Local usage of SmartPointer instance. More...
#include <ISmartPointer.hpp>
Public Member Functions | |
LocalObject (ISmartPointer *ptr) | |
~LocalObject () | |
ISmartPointer * | getPtr () |
Local usage of SmartPointer instance.
Small utility for locally getting a reference on a smart pointer. It creates a local (ie created in the execution stack) object that takes a reference on a smart pointer and get rid of it when the execution is out of the statements block holding the local object.
Note that the LocalObject class is very close to the std::auto_ptr. The first one uses inheritance, the second uses templates.
Sample:
|
inline |
Constructor.
[in] | ptr | : the instance we want locally manage. |
|
inline |
Destructor.
|
inline |
Getter on the referenced instance.