|
ACF $AcfVersion:0$
|
Pointer wrapper providing activatable deleting pointed object during destruction. More...
#include <TOptDelPtr.h>
Public Types | |
| typedef TPointerBase< Type > | BaseClass |
Public Member Functions | |
| TOptDelPtr (Type *ptr=NULL, bool releaseFlag=false) | |
| Construct and init this pointer. | |
| TOptDelPtr (const TOptDelPtr &ptr) | |
| Copy constructor. | |
| ~TOptDelPtr () | |
| Destructor. | |
| bool | IsToRelase () const |
| Get state of release flag. | |
| void | Reset () |
| Remove object pointed by internal pointer and set this pointer to NULL. | |
| void | SetPtr (Type *ptr, bool releaseFlag=false) |
| Set new value of internal pointer. | |
| Type * | PopPtr () |
| Reset internal pointer value without deleting instance and return previos value. | |
| void | TakeOver (TOptDelPtr &sourcePtr) |
| Take internal pointer over. | |
| TOptDelPtr & | operator= (const TOptDelPtr &ptr) |
| Assign operator. | |
| TOptDelPtr & | operator= (Type *ptr) |
| Assign operator. | |
| template<class SourceType > | |
| bool | SetCastedOrRemove (SourceType *ptr, bool releaseFlag=false) |
| 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 activatable deleting pointed object during destruction.
Definition at line 20 of file TOptDelPtr.h.
| typedef TPointerBase<Type> istd::TOptDelPtr< Type, DelArray >::BaseClass |
Definition at line 23 of file TOptDelPtr.h.
|
inline |
Construct and init this pointer.
| ptr | pointer to object. |
| releaseFlag | if true, pointed object will be automatically released. |
Definition at line 124 of file TOptDelPtr.h.
|
inline |
Copy constructor.
This implementation has no function and is provided only for compatibility with STL. The source pointer must be invalid (NULL).
Definition at line 131 of file TOptDelPtr.h.
References istd::TPointerBase< Type >::GetPtr(), NULL, and istd::TOptDelPtr< Type, DelArray >::SetPtr().
|
inline |
|
protected |
Remove referenced object.
Warning: internal pointer will be not changed.
Definition at line 222 of file TOptDelPtr.h.
References NULL.
|
inline |
Get state of release flag.
If this flag is true, pointed object will be automatically removed from memory. If this pointer isn't valid, returned value has no meaning.
Definition at line 159 of file TOptDelPtr.h.
Referenced by istd::TOptDelPtr< Type, DelArray >::TakeOver().
| TOptDelPtr & istd::TOptDelPtr< Type, DelArray >::operator= | ( | const TOptDelPtr< Type, DelArray > & | ptr | ) |
Assign operator.
This implementation has no function and is provided only for compatibility with STL. The source pointer must be invalid (NULL).
| TOptDelPtr< Type, DelArray > & istd::TOptDelPtr< Type, DelArray >::operator= | ( | Type * | ptr | ) |
Assign operator.
It removes refererenced object before new is assigned.
| ptr | pointer to object. |
Definition at line 209 of file TOptDelPtr.h.
|
inline |
Reset internal pointer value without deleting instance and return previos value.
Definition at line 177 of file TOptDelPtr.h.
References NULL.
Referenced by istd::TOptDelPtr< Type, DelArray >::TakeOver().
|
inline |
Remove object pointed by internal pointer and set this pointer to NULL.
Definition at line 152 of file TOptDelPtr.h.
References NULL.
|
inline |
Set internal pointer using casted pointer of other type.
If casting is not possible, parameter object will be removed.
| releaseFlag | if true, pointed object will be automatically released. |
Definition at line 93 of file TOptDelPtr.h.
References NULL, and istd::TOptDelPtr< Type, DelArray >::SetPtr().
|
inline |
Set new value of internal pointer.
If internal pointer wasn't NULL, it will be deleted.
| releaseFlag | if true, pointed object will be automatically released. |
Definition at line 166 of file TOptDelPtr.h.
Referenced by istd::TOptDelPtr< Type, DelArray >::SetCastedOrRemove(), and istd::TOptDelPtr< Type, DelArray >::TOptDelPtr().
| void istd::TOptDelPtr< Type, DelArray >::TakeOver | ( | TOptDelPtr< Type, DelArray > & | sourcePtr | ) |
Take internal pointer over.
It set pointer from other object and detach it from them.
Definition at line 187 of file TOptDelPtr.h.
References istd::TOptDelPtr< Type, DelArray >::IsToRelase(), and istd::TOptDelPtr< Type, DelArray >::PopPtr().