#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 58 of file igtlSmartPointer.h.
typedef TObjectType igtl::SmartPointer< TObjectType >::ObjectType |
Definition at line 61 of file igtlSmartPointer.h.
|
inline |
Constructor
Definition at line 64 of file igtlSmartPointer.h.
|
inline |
Copy constructor
Definition at line 68 of file igtlSmartPointer.h.
|
inline |
Constructor to pointer p
Definition at line 73 of file igtlSmartPointer.h.
|
inline |
Destructor
Definition at line 78 of file igtlSmartPointer.h.
|
inline |
Access function to pointer.
Definition at line 110 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 94 of file igtlSmartPointer.h.
|
inline |
Test if the pointer has been initialized
Definition at line 96 of file igtlSmartPointer.h.
|
inline |
Return pointer to object.
Definition at line 90 of file igtlSmartPointer.h.
|
inline |
Definition at line 106 of file igtlSmartPointer.h.
|
inline |
Overload operator ->
Definition at line 86 of file igtlSmartPointer.h.
|
inline |
Comparison of pointers. Less than comparison.
Definition at line 114 of file igtlSmartPointer.h.
|
inline |
Comparison of pointers. Less than or equal to comparison.
Definition at line 122 of file igtlSmartPointer.h.
|
inline |
Overload operator assignment.
Definition at line 130 of file igtlSmartPointer.h.
|
inline |
Overload operator assignment.
Definition at line 134 of file igtlSmartPointer.h.
|
inline |
Template comparison operators.
Definition at line 102 of file igtlSmartPointer.h.
|
inline |
Comparison of pointers. Greater than comparison.
Definition at line 118 of file igtlSmartPointer.h.
|
inline |
Comparison of pointers. Greater than or equal to comparison.
Definition at line 126 of file igtlSmartPointer.h.
|
inline |
Function to print object pointed to
Definition at line 148 of file igtlSmartPointer.h.