#include <TempRef.h>
Therefore, this class holds a pointer to a reference counted object but doesn't up the reference count, and enforces that the pointer is released before the class is destroyed since the temporary destructor will PANIC if the pointer is non-NULL;
Definition at line 58 of file TempRef.h.
Public Member Functions | |
TempRef (const char *what1, const char *what2="") | |
Constructor that initializes the pointer to be empty. | |
TempRef (_Type *object, const char *what1, const char *what2="") | |
Constructor that takes an initial pointer for assignment. | |
TempRef (const TempRef &other) | |
Copy constructor. | |
~TempRef () | |
Destructor that asserts the pointer was claimed. | |
TempRef & | operator= (const TempRef< _Type > &other) |
Assignment operator. | |
TempRef & | operator= (_Type *object) |
Assignment operator. | |
_Type * | object () const |
Accessor for the object. | |
_Type * | operator-> () const |
Operator overload for pointer access. | |
_Type & | operator * () const |
Operator overload for pointer access. | |
void | release () const |
Release the reference to the object. | |
bool | operator== (_Type *o) |
Equality operator. | |
bool | operator!= (_Type *o) |
Inequality operator. | |
const char * | what1 () const |
const char * | what2 () const |
Private Attributes | |
_Type * | object_ |
The object pointer. | |
const char * | what1_ |
Debugging strings. | |
const char * | what2_ |
oasys::TempRef< _Type >::TempRef | ( | const char * | what1, | |
const char * | what2 = "" | |||
) | [inline] |
oasys::TempRef< _Type >::TempRef | ( | _Type * | object, | |
const char * | what1, | |||
const char * | what2 = "" | |||
) | [inline] |
oasys::TempRef< _Type >::TempRef | ( | const TempRef< _Type > & | other | ) | [inline] |
Copy constructor.
Definition at line 79 of file TempRef.h.
References oasys::TempRef< _Type >::object(), oasys::TempRef< _Type >::object_, and oasys::TempRef< _Type >::release().
oasys::TempRef< _Type >::~TempRef | ( | ) | [inline] |
Destructor that asserts the pointer was claimed.
Definition at line 88 of file TempRef.h.
References oasys::TempRef< _Type >::object_, oasys::TempRef< _Type >::what1_, and oasys::TempRef< _Type >::what2_.
TempRef& oasys::TempRef< _Type >::operator= | ( | const TempRef< _Type > & | other | ) | [inline] |
Assignment operator.
Definition at line 98 of file TempRef.h.
References oasys::TempRef< _Type >::object(), oasys::TempRef< _Type >::object_, and oasys::TempRef< _Type >::release().
TempRef& oasys::TempRef< _Type >::operator= | ( | _Type * | object | ) | [inline] |
Assignment operator.
Definition at line 108 of file TempRef.h.
References oasys::TempRef< _Type >::object_.
_Type* oasys::TempRef< _Type >::object | ( | ) | const [inline] |
Accessor for the object.
Definition at line 119 of file TempRef.h.
References oasys::TempRef< _Type >::object_.
Referenced by oasys::TempRef< _Type >::operator=(), oasys::Ref< _Type >::operator=(), oasys::Ref< _Type >::Ref(), and oasys::TempRef< _Type >::TempRef().
_Type* oasys::TempRef< _Type >::operator-> | ( | ) | const [inline] |
Operator overload for pointer access.
Definition at line 126 of file TempRef.h.
References oasys::TempRef< _Type >::object_.
_Type& oasys::TempRef< _Type >::operator * | ( | ) | const [inline] |
Operator overload for pointer access.
Definition at line 134 of file TempRef.h.
References oasys::TempRef< _Type >::object_.
void oasys::TempRef< _Type >::release | ( | ) | const [inline] |
Release the reference to the object.
Note this is declared const even though it technically modifies the object.
Definition at line 143 of file TempRef.h.
References oasys::TempRef< _Type >::object_.
Referenced by oasys::TempRef< _Type >::operator=(), oasys::Ref< _Type >::operator=(), oasys::Ref< _Type >::Ref(), and oasys::TempRef< _Type >::TempRef().
bool oasys::TempRef< _Type >::operator== | ( | _Type * | o | ) | [inline] |
Equality operator.
Definition at line 150 of file TempRef.h.
References oasys::TempRef< _Type >::object_.
bool oasys::TempRef< _Type >::operator!= | ( | _Type * | o | ) | [inline] |
Inequality operator.
Definition at line 158 of file TempRef.h.
References oasys::TempRef< _Type >::object_.
const char* oasys::TempRef< _Type >::what1 | ( | ) | const [inline] |
const char* oasys::TempRef< _Type >::what2 | ( | ) | const [inline] |
_Type* oasys::TempRef< _Type >::object_ [mutable, private] |
The object pointer.
Definition at line 170 of file TempRef.h.
Referenced by oasys::TempRef< _Type >::object(), oasys::TempRef< _Type >::operator *(), oasys::TempRef< _Type >::operator!=(), oasys::TempRef< _Type >::operator->(), oasys::TempRef< _Type >::operator=(), oasys::TempRef< _Type >::operator==(), oasys::TempRef< _Type >::release(), oasys::TempRef< _Type >::TempRef(), and oasys::TempRef< _Type >::~TempRef().
const char* oasys::TempRef< _Type >::what1_ [private] |
Debugging strings.
Definition at line 175 of file TempRef.h.
Referenced by oasys::TempRef< _Type >::what1(), and oasys::TempRef< _Type >::~TempRef().
const char * oasys::TempRef< _Type >::what2_ [private] |
Definition at line 175 of file TempRef.h.
Referenced by oasys::TempRef< _Type >::what2(), and oasys::TempRef< _Type >::~TempRef().