![]() |
Public API Reference |
#include <ref.h>
Public Methods | |
csRef () | |
Construct an invalid smart pointer (that is, one pointing at nothing). More... | |
csRef (const csPtr< T > &newobj) | |
Construct a smart pointer from a csPtr. More... | |
csRef (T *newobj) | |
Construct a smart pointer from a raw object reference. More... | |
csRef (csRef const &other) | |
Smart pointer copy constructor. More... | |
~csRef () | |
Smart pointer destructor. More... | |
csRef & | operator= (const csPtr< T > &newobj) |
Assign a csPtr to a smart pointer. More... | |
csRef & | operator= (T *newobj) |
Assign a raw object reference to this smart pointer. More... | |
void | AttachNew (csPtr< T > newObj) |
Assign an object reference created with the new operator to this smart pointer. More... | |
csRef & | operator= (csRef const &other) |
Assign another object to this smart pointer. More... | |
T * | operator-> () const |
Dereference underlying object. More... | |
operator T * () const | |
Cast smart pointer to a pointer to the underlying object. More... | |
T & | operator * () const |
Dereference underlying object. More... | |
bool | IsValid () const |
Smart pointer validity check. More... | |
Friends | |
bool | operator== (const csRef &r1, const csRef &r2) |
Test if the two references point to same object. More... | |
bool | operator!= (const csRef &r1, const csRef &r2) |
Test if the two references point to different object. More... | |
bool | operator== (const csRef &r1, T *obj) |
Test if object pointed to by reference is same as obj. More... | |
bool | operator!= (const csRef &r1, T *obj) |
Test if object pointed to by reference is different from obj. More... | |
bool | operator== (T *obj, const csRef &r1) |
Test if object pointed to by reference is same as obj. More... | |
bool | operator!= (T *obj, const csRef &r1) |
Test if object pointed to by reference is different from obj. More... |
Maintains and correctly manages a reference to a reference-counted object. This template requires only that the object type T implement the methods IncRef() and DecRef(). No other requirements are placed upon T.
Definition at line 84 of file ref.h.
|
Construct an invalid smart pointer (that is, one pointing at nothing). Dereferencing or attempting to use the invalid pointer will result in a run-time error, however it is safe to invoke IsValid(). |
|
Construct a smart pointer from a csPtr. Doesn't call IncRef() on the object since it is assumed that the object in csPtr is already IncRef()'ed. |
|
Construct a smart pointer from a raw object reference. Calls IncRef() on the object. |
|
Smart pointer copy constructor.
|
|
Smart pointer destructor. Invokes DecRef() upon the underlying object. |
|
Assign an object reference created with the new operator to this smart pointer.
|
|
Smart pointer validity check. Returns true if smart pointer is pointing at an actual object, otherwise returns false. |
|
Dereference underlying object.
|
|
Cast smart pointer to a pointer to the underlying object.
|
|
Dereference underlying object.
|
|
Assign another object to this smart pointer.
|
|
Assign a raw object reference to this smart pointer.
|
|
Assign a csPtr to a smart pointer. Doesn't call IncRef() on the object since it is assumed that the object in csPtr is already IncRef()'ed.
Definition at line 150 of file ref.h. Referenced by csRef< iGraphics2D >::operator=. |
|
Test if object pointed to by reference is different from obj.
|
|
Test if object pointed to by reference is different from obj.
|
|
Test if the two references point to different object.
|
|
Test if object pointed to by reference is same as obj.
|
|
Test if object pointed to by reference is same as obj.
|
|
Test if the two references point to same object.
|