An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and with pointer allocation checking on access. More...
Public Types | |
typedef T | Type |
Public Member Functions | |
UautoPtr (T *=nullptr) | |
Store object pointer. More... | |
UautoPtr (const UautoPtr< T > &) | |
Copy constructor. More... | |
bool | empty () const |
Return true if the UautoPtr is empty (ie, no pointer set) More... | |
bool | valid () const |
Return true if the UautoPtr valid (ie, the pointer is set) More... | |
T * | ptr () |
Return object pointer for reuse. More... | |
void | set (T *) |
Set pointer to that given. More... | |
void | reset (T *=nullptr) |
Set pointer to that given. More... | |
void | clear () |
Set pointer to nullptr. More... | |
T & | operator() () |
Return reference to the object data. More... | |
const T & | operator() () const |
Return const reference to the object data. More... | |
T & | operator* () |
Return reference to the object data. More... | |
const T & | operator* () const |
Return const reference to the object data. More... | |
operator const T & () const | |
Const cast to the underlying type reference. More... | |
T * | operator-> () |
Return object pointer. More... | |
const T * | operator-> () const |
Return const object pointer. More... | |
void | operator= (T *) |
Take over the object pointer from parameter. More... | |
void | operator= (const UautoPtr< T > &) |
Take over the object pointer from parameter. More... | |
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and with pointer allocation checking on access.
Definition at line 50 of file UautoPtr.H.
Definition at line 60 of file UautoPtr.H.
Store object pointer.
Definition at line 32 of file UautoPtrI.H.
Copy constructor.
Definition at line 39 of file UautoPtrI.H.
|
inline |
Return true if the UautoPtr is empty (ie, no pointer set)
Definition at line 48 of file UautoPtrI.H.
|
inline |
Return true if the UautoPtr valid (ie, the pointer is set)
Definition at line 55 of file UautoPtrI.H.
|
inline |
Return object pointer for reuse.
Definition at line 62 of file UautoPtrI.H.
Referenced by UautoPtr< T >::operator=().
|
inline |
Set pointer to that given.
If object pointer already set issue a FatalError
Definition at line 69 of file UautoPtrI.H.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, Foam::name(), p, and Foam::T().
|
inline |
Set pointer to that given.
Definition at line 84 of file UautoPtrI.H.
References p.
Referenced by UautoPtr< T >::clear(), and UautoPtr< T >::operator=().
|
inline |
Set pointer to nullptr.
Definition at line 91 of file UautoPtrI.H.
References UautoPtr< T >::reset().
|
inline |
Return reference to the object data.
Definition at line 100 of file UautoPtrI.H.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, Foam::name(), and Foam::T().
Referenced by UautoPtr< T >::operator const T &().
|
inline |
Return const reference to the object data.
Definition at line 115 of file UautoPtrI.H.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, Foam::name(), and Foam::T().
|
inline |
Return reference to the object data.
Definition at line 130 of file UautoPtrI.H.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, Foam::name(), and Foam::T().
|
inline |
Return const reference to the object data.
Definition at line 145 of file UautoPtrI.H.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, Foam::name(), and Foam::T().
|
inline |
Const cast to the underlying type reference.
Definition at line 160 of file UautoPtrI.H.
References UautoPtr< T >::operator()().
|
inline |
Return object pointer.
Definition at line 167 of file UautoPtrI.H.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, Foam::name(), and Foam::T().
|
inline |
Return const object pointer.
Definition at line 182 of file UautoPtrI.H.
|
inline |
Take over the object pointer from parameter.
Definition at line 189 of file UautoPtrI.H.
References UautoPtr< T >::reset().
Take over the object pointer from parameter.
Definition at line 196 of file UautoPtrI.H.
References UautoPtr< T >::ptr(), and UautoPtr< T >::reset().