Classes | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
istd::TTransPtr< Type > Class Template Reference

Implementation of data transfer smart pointer. More...

#include <TTransPtr.h>

Inheritance diagram for istd::TTransPtr< Type >:
istd::TSmartPtr< Type, Accessor >

Classes

class  RefCountBase
 

Public Member Functions

 TTransPtr (const TTransPtr &pointer)
 Constructor overtaking the pointer. More...
 
 ~TTransPtr ()
 
bool IsValid () const
 Check, whether the object is in valid state. More...
 
const Type * GetPtr () const
 Get access to pointed object. More...
 
Type * GetPtr ()
 Get access to pointed object. More...
 
void Reset ()
 Set this pointer to NULL. More...
 
void Swap (TTransPtr &pointer)
 Swap two pointers. More...
 
template<class CastedType >
CastedType Cast () const
 
TTransPtroperator= (const TTransPtr &pointer)
 Copy operator overtaking the pointer. More...
 
Type & operator* () const
 
Type * operator-> () const
 

Protected Member Functions

 TTransPtr ()
 
void Detach ()
 Detach counter object without changing of internal counter pointer. More...
 
RefCountBaseGetInternalCounter (const TTransPtr &pointer) const
 Get internal counter. More...
 

Protected Attributes

RefCountBasem_counterPtr
 

Detailed Description

template<class Type>
class istd::TTransPtr< Type >

Implementation of data transfer smart pointer.

It should be used to pointer transfer only, not to store the pointers becouse it overtakes the pointer. Typically it is used as smart pointer return parameters. The adventage against 'normal' smart pointer (istd::TSmartPtr) is that the copy constructor is faster, because it overtakes the pointer.

See Also
istd::TSmartPtr

Definition at line 24 of file TTransPtr.h.

Constructor & Destructor Documentation

template<class Type >
istd::TTransPtr< Type >::TTransPtr ( const TTransPtr< Type > &  pointer)

Constructor overtaking the pointer.

Parameters
pointerpointer to overtake - warning: After this operation this pointer is invalid!

Definition at line 116 of file TTransPtr.h.

References istd::TTransPtr< Type >::m_counterPtr, and NULL.

template<class Type >
istd::TTransPtr< Type >::~TTransPtr ( )

Definition at line 124 of file TTransPtr.h.

template<class Type >
istd::TTransPtr< Type >::TTransPtr ( )
protected

Definition at line 215 of file TTransPtr.h.

Member Function Documentation

template<class Type>
template<class CastedType >
CastedType istd::TTransPtr< Type >::Cast ( ) const
inline

Definition at line 60 of file TTransPtr.h.

template<class Type >
void istd::TTransPtr< Type >::Detach ( )
inlineprotected

Detach counter object without changing of internal counter pointer.

Definition at line 222 of file TTransPtr.h.

References NULL.

template<class Type >
TTransPtr< Type >::RefCountBase * istd::TTransPtr< Type >::GetInternalCounter ( const TTransPtr< Type > &  pointer) const
protected

Get internal counter.

Definition at line 231 of file TTransPtr.h.

References istd::TTransPtr< Type >::m_counterPtr.

Referenced by istd::TSmartPtr< Type, Accessor >::TSmartPtr().

template<class Type >
const Type * istd::TTransPtr< Type >::GetPtr ( ) const
inline
template<class Type >
Type * istd::TTransPtr< Type >::GetPtr ( )
inline

Get access to pointed object.

Definition at line 150 of file TTransPtr.h.

References NULL.

template<class Type >
bool istd::TTransPtr< Type >::IsValid ( ) const

Check, whether the object is in valid state.

Definition at line 131 of file TTransPtr.h.

References NULL.

Referenced by ibase::TFactorisableContainer< InterfaceClass >::AddElement(), and ibase::TFactorisableContainer< InterfaceClass >::InsertElement().

template<class Type >
Type & istd::TTransPtr< Type >::operator* ( ) const
inline

Definition at line 193 of file TTransPtr.h.

References NULL.

template<class Type >
Type * istd::TTransPtr< Type >::operator-> ( ) const
inline

Definition at line 203 of file TTransPtr.h.

References NULL.

template<class Type >
TTransPtr< Type > & istd::TTransPtr< Type >::operator= ( const TTransPtr< Type > &  pointer)

Copy operator overtaking the pointer.

Parameters
pointerpointer to overtake - warning: After this operation this pointer is invalid!

Definition at line 178 of file TTransPtr.h.

References istd::TTransPtr< Type >::m_counterPtr, and NULL.

template<class Type >
void istd::TTransPtr< Type >::Reset ( )

Set this pointer to NULL.

Definition at line 162 of file TTransPtr.h.

References NULL.

template<class Type >
void istd::TTransPtr< Type >::Swap ( TTransPtr< Type > &  pointer)

Swap two pointers.

Definition at line 171 of file TTransPtr.h.

References istd::TTransPtr< Type >::m_counterPtr.

Member Data Documentation

template<class Type>
RefCountBase* istd::TTransPtr< Type >::m_counterPtr
protected

The documentation for this class was generated from the following file:

© 2007-2017 Witold Gantzke and Kirill Lepskiy