Public Member Functions | |
OFauto_ptr (T *p=NULL) | |
constructs a OFauto_ptr from the given pointer. | |
OFauto_ptr (OFauto_ptr< T > &other) | |
constructs a OFauto_ptr from another OFauto_ptr. | |
OFauto_ptr (OFauto_ptr_ref< T > other) | |
constructs a OFauto_ptr from an OFauto_ptr_ref. | |
~OFauto_ptr () | |
destructor. | |
void | reset (T *p=NULL) |
assign another pointer to this OFauto_ptr, possibly deleting our current pointer. | |
T * | get () const |
get the pointer that is managed by this class. | |
T * | operator-> () const |
get the pointer that is managed by this class. | |
T & | operator * () const |
get the pointer that is managed by this class. | |
operator OFauto_ptr_ref () | |
this is used automatically by the compiler, don't call directly. | |
OFauto_ptr & | operator= (OFauto_ptr< T > &other) |
assigns the other pointer to this OFauto_ptr | |
OFauto_ptr & | operator= (OFauto_ptr_ref< T > other) |
assigns the other pointer to this OFauto_ptr | |
T * | release () |
release the pointer that is managed by this class. | |
Protected Attributes | |
T * | ptr |
the pointer that it's all about |
This class does NOT do reference counting! This is a reimplementation of std::auto_ptr.
Definition at line 76 of file ofaptr.h.
OFauto_ptr< T >::OFauto_ptr | ( | T * | p = NULL |
) | [inline, explicit] |
constructs a OFauto_ptr from the given pointer.
You must not call delete on a pointer that is managed by OFauto_ptr!
p | the pointer |
OFauto_ptr< T >::OFauto_ptr | ( | OFauto_ptr< T > & | other | ) | [inline] |
constructs a OFauto_ptr from another OFauto_ptr.
The other OFauto_ptr will be invalidated. This means he will point to NULL from now on!.
other | the OFauto_ptr to get the pointer from. |
OFauto_ptr< T >::OFauto_ptr | ( | OFauto_ptr_ref< T > | other | ) | [inline] |
constructs a OFauto_ptr from an OFauto_ptr_ref.
other | the OFauto_ptr_ref to get the pointer from. |
OFauto_ptr< T >::~OFauto_ptr | ( | ) | [inline] |
void OFauto_ptr< T >::reset | ( | T * | p = NULL |
) | [inline] |
assign another pointer to this OFauto_ptr, possibly deleting our current pointer.
p | the new pointer |
Definition at line 118 of file ofaptr.h.
Referenced by OFauto_ptr< DecoderStrategy >::operator=(), and OFauto_ptr< DecoderStrategy >::~OFauto_ptr().
T* OFauto_ptr< T >::get | ( | ) | const [inline] |
get the pointer that is managed by this class.
Definition at line 128 of file ofaptr.h.
Referenced by EncoderStrategy::AppendToBitStream(), OFauto_ptr< DecoderStrategy >::operator *(), OFauto_ptr< DecoderStrategy >::operator->(), and log4cplus::spi::FactoryRegistry< T >::put().
T* OFauto_ptr< T >::operator-> | ( | ) | const [inline] |
T& OFauto_ptr< T >::operator * | ( | ) | const [inline] |
OFauto_ptr< T >::operator OFauto_ptr_ref | ( | ) | [inline] |
this is used automatically by the compiler, don't call directly.
OFauto_ptr& OFauto_ptr< T >::operator= | ( | OFauto_ptr< T > & | other | ) | [inline] |
assigns the other pointer to this OFauto_ptr
other | other Ofauto_ptr which will be invalidated |
OFauto_ptr& OFauto_ptr< T >::operator= | ( | OFauto_ptr_ref< T > | other | ) | [inline] |
assigns the other pointer to this OFauto_ptr
other | other Ofauto_ptr_ref |
T* OFauto_ptr< T >::release | ( | ) | [inline] |
release the pointer that is managed by this class.
You are now responsible for destroying that pointer yourself!
Definition at line 172 of file ofaptr.h.
Referenced by OFauto_ptr< DecoderStrategy >::operator OFauto_ptr_ref(), OFauto_ptr< DecoderStrategy >::operator=(), and log4cplus::spi::FactoryRegistry< T >::put().