#include <igtlSmartPointer.h>
Public Types | |
typedef TObjectType | ObjectType |
Public Member Functions | |
ObjectType * | GetPointer () const |
operator ObjectType * () const | |
template<typename R > | |
bool | operator!= (R r) const |
ObjectType * | operator-> () const |
bool | operator< (const SmartPointer &r) const |
bool | operator<= (const SmartPointer &r) const |
SmartPointer & | operator= (const SmartPointer &r) |
template<typename R > | |
bool | operator== (R r) const |
bool | operator> (const SmartPointer &r) const |
bool | operator>= (const SmartPointer &r) const |
SmartPointer () | |
SmartPointer (const SmartPointer< ObjectType > &p) | |
SmartPointer (ObjectType *p) | |
~SmartPointer () | |
bool | IsNotNull () const |
bool | IsNull () const |
SmartPointer & | operator= (ObjectType *r) |
ObjectType * | Print (std::ostream &os) const |
Implements transparent reference counting.
SmartPointer implements reference counting by overloading operator -> (and *) among others. This allows natural interface to the class referred to by the pointer without having to invoke special Register()/UnRegister() methods directly.
To compile / test this class Windows: cl SmartPointerTest.cxx; ..exe linux: c++ SmartPointerTest.cxx ./a.out other: CCcompiler SmartPointerTest.cxx ./a.out
Definition at line 56 of file igtlSmartPointer.h.
typedef TObjectType igtl::SmartPointer< TObjectType >::ObjectType |
Definition at line 59 of file igtlSmartPointer.h.
|
inline |
Constructor
Definition at line 62 of file igtlSmartPointer.h.
|
inline |
Copy constructor
Definition at line 66 of file igtlSmartPointer.h.
|
inline |
Constructor to pointer p
Definition at line 71 of file igtlSmartPointer.h.
|
inline |
Destructor
Definition at line 76 of file igtlSmartPointer.h.
|
inline |
Access function to pointer.
Definition at line 108 of file igtlSmartPointer.h.
Referenced by igtl::ObjectFactory< T >::Create(), igtl::CreateObjectFunction< T >::CreateObject(), and igtl::SmartPointer< Self >::operator=().
|
inline |
Test if the pointer has been initialized
Definition at line 92 of file igtlSmartPointer.h.
|
inline |
Test if the pointer has been initialized
Definition at line 94 of file igtlSmartPointer.h.
|
inline |
Return pointer to object.
Definition at line 88 of file igtlSmartPointer.h.
|
inline |
Definition at line 104 of file igtlSmartPointer.h.
|
inline |
Overload operator ->
Definition at line 84 of file igtlSmartPointer.h.
|
inline |
Comparison of pointers. Less than comparison.
Definition at line 112 of file igtlSmartPointer.h.
|
inline |
Comparison of pointers. Less than or equal to comparison.
Definition at line 120 of file igtlSmartPointer.h.
|
inline |
Overload operator assignment.
Definition at line 128 of file igtlSmartPointer.h.
|
inline |
Overload operator assignment.
Definition at line 132 of file igtlSmartPointer.h.
|
inline |
Template comparison operators.
Definition at line 100 of file igtlSmartPointer.h.
|
inline |
Comparison of pointers. Greater than comparison.
Definition at line 116 of file igtlSmartPointer.h.
|
inline |
Comparison of pointers. Greater than or equal to comparison.
Definition at line 124 of file igtlSmartPointer.h.
|
inline |
Function to print object pointed to
Definition at line 146 of file igtlSmartPointer.h.