UCommon
|
Typed smart pointer class. More...
#include <object.h>
Public Member Functions | |
T * | get (void) const |
Get pointer to object. | |
object_pointer () | |
Create a pointer with no reference. | |
object_pointer (const object_pointer ©) | |
object_pointer (T *object) | |
Create a pointer with a reference to a heap object. | |
operator bool () const | |
See if pointer is set. | |
bool | operator! () const |
See if pointer is not set. | |
T & | operator() () const |
Reference object we are pointing to through function reference. | |
T * | operator* () const |
Reference object we are pointing to through pointer indirection. | |
T * | operator-> () const |
Reference member of object we are pointing to. | |
object_pointer & | operator= (const object_pointer &from) |
object_pointer & | operator= (T *typed) |
Perform assignment operator to existing object. | |
![]() | |
operator bool () const | |
Test if the pointer is referencing an object. | |
bool | operator! () const |
Test if the pointer is not set. | |
void | release (void) |
Manually release the pointer. | |
Additional Inherited Members | |
![]() | |
AutoObject (const AutoObject &pointer) | |
Construct an auto-pointer as a copy of another pointer. | |
AutoObject (ObjectProtocol *object) | |
Construct an auto-pointer referencing an existing object. | |
void | set (ObjectProtocol *object) |
Set our pointer to a specific object. | |
~AutoObject () | |
Delete auto pointer. | |
![]() | |
ObjectProtocol * | object |
Typed smart pointer class.
This is used to manage references to a specific typed object on the heap that is derived from the base Object class. This is most commonly used to manage references to reference counted heap objects so their heap usage can be auto-managed while there is active references to such objects. Pointers are usually created on the stack frame and used to reference an object during the life of a member function. They can be created in other objects that live on the heap and can be used to maintain active references so long as the object they are contained in remains in scope as well.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |