|
ACF $AcfVersion:0$
|
Pointer wrapper providing automatic deleting pointed object during destruction. More...
#include <TDelPtr.h>
Public Types | |
| typedef TPointerBase< Type > | BaseClass |
Public Member Functions | |
| TDelPtr (Type *ptr=NULL) | |
| Construct and init this pointer. | |
| TDelPtr (const TDelPtr &ptr) | |
| Copy constructor. | |
| TDelPtr (TDelPtr &&ptr) | |
| Move constructor. | |
| ~TDelPtr () | |
| Destructor. | |
| void | Reset () |
| Remove object pointed by internal pointer and set this pointer to NULL. | |
| void | SetPtr (Type *ptr) |
| Set new value of internal pointer. | |
| Type * | PopPtr () |
| Reset internal pointer value without deleting instance and return previos value. | |
| void | TakeOver (TDelPtr &sourcePtr) |
| Take internal pointer over. | |
| TDelPtr & | operator= (const TDelPtr &ptr) |
| Assign operator. | |
| TDelPtr & | operator= (TDelPtr &&ptr) |
| Move operator. | |
| TDelPtr & | operator= (Type *ptr) |
| Assign operator. | |
| template<class SourceType > | |
| bool | SetCastedOrRemove (SourceType *ptr) |
| Set internal pointer using casted pointer of other type. | |
Public Member Functions inherited from istd::TPointerBase< Type > | |
| TPointerBase (Type *ptr=NULL) | |
| Construct and assign internal pointer. | |
| void | SetPtr (Type *ptr) |
| Set value of internal stored pointer. | |
| void | Reset () |
| Set internal pointer value to NULL. | |
| Type * | GetPtr () const |
| Return access to internal stored pointer. | |
| bool | IsValid () const |
| Check if internal pointer not NULL. | |
| void | Swap (TPointerBase &ptr) |
| Swap two pointers. | |
| Type & | operator* () const |
| Get an access to object pointed at. | |
| template<class CastedType > | |
| CastedType | Cast () const |
| Type * | operator-> () const |
| bool | operator== (const TPointerBase< Type > &ptr) const |
| bool | operator!= (const TPointerBase< Type > &ptr) const |
| bool | operator< (const TPointerBase< Type > &ptr) const |
| bool | operator> (const TPointerBase< Type > &ptr) const |
| bool | operator<= (const TPointerBase< Type > &ptr) const |
| bool | operator>= (const TPointerBase< Type > &ptr) const |
| bool | operator== (const Type *ptr) const |
| bool | operator!= (const Type *ptr) const |
| bool | operator< (const Type *ptr) const |
| bool | operator> (const Type *ptr) const |
| bool | operator<= (const Type *ptr) const |
| bool | operator>= (const Type *ptr) const |
Protected Member Functions | |
| void | Detach () |
| Remove referenced object. | |
Protected Member Functions inherited from istd::TPointerBase< Type > | |
| TPointerBase< Type > & | operator= (const TPointerBase< Type > ptr) |
| Type *& | GetPtrRef () |
Pointer wrapper providing automatic deleting pointed object during destruction.
| typedef TPointerBase<Type> istd::TDelPtr< Type, Accessor >::BaseClass |
|
inline |
| istd::TDelPtr< Type, Accessor >::TDelPtr | ( | const TDelPtr< Type, Accessor > & | ptr | ) |
Copy constructor.
This implementation has no function and is provided only for compatibility with STL. The source pointer must be invalid (NULL).
|
inline |
Move constructor.
Definition at line 139 of file TDelPtr.h.
References istd::TDelPtr< Type, Accessor >::SetPtr().
|
inline |
Destructor.
It calls Reset() to delete pointed object.
Definition at line 147 of file TDelPtr.h.
References istd::TDelPtr< Type, Accessor >::Detach().
|
protected |
Remove referenced object.
Warning: internal pointer will be not changed.
Definition at line 222 of file TDelPtr.h.
References NULL.
Referenced by istd::TDelPtr< Type, Accessor >::~TDelPtr().
| TDelPtr & istd::TDelPtr< Type, Accessor >::operator= | ( | const TDelPtr< Type, Accessor > & | ptr | ) |
Assign operator.
This implementation has no function and is provided only for compatibility with STL. The source pointer must be invalid (NULL).
| TDelPtr< Type, Accessor > & istd::TDelPtr< Type, Accessor >::operator= | ( | TDelPtr< Type, Accessor > && | ptr | ) |
| TDelPtr< Type, Accessor > & istd::TDelPtr< Type, Accessor >::operator= | ( | Type * | ptr | ) |
|
inline |
Reset internal pointer value without deleting instance and return previos value.
Definition at line 170 of file TDelPtr.h.
References NULL.
Referenced by ilog::TExtMessage< Element >::CloneMe(), and istd::TDelPtr< Type, Accessor >::TakeOver().
|
inline |
|
inline |
Set internal pointer using casted pointer of other type.
If casting is not possible, parameter object will be removed.
Definition at line 94 of file TDelPtr.h.
References NULL, and istd::TDelPtr< Type, Accessor >::SetPtr().
|
inline |
Set new value of internal pointer.
If internal pointer wasn't NULL, it will be deleted.
Definition at line 161 of file TDelPtr.h.
Referenced by icomp::CSimComponentContextBase::InsertMultiAttr(), istd::TDelPtr< Type, Accessor >::SetCastedOrRemove(), and istd::TDelPtr< Type, Accessor >::TDelPtr().
| void istd::TDelPtr< Type, Accessor >::TakeOver | ( | TDelPtr< Type, Accessor > & | sourcePtr | ) |
Take internal pointer over.
It set pointer from other object and detach it from them.
Definition at line 180 of file TDelPtr.h.
References istd::TDelPtr< Type, Accessor >::PopPtr().