OpendTect-6_4  6.4
Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
PtrManBase< T > Class Template Reference
Inheritance diagram for PtrManBase< T >:
[legend]

Public Types

typedef T *(* PointerCreator) ()
 

Public Member Functions

bool operator! () const
 
T * set (T *p, bool doerase=true)
 Returns old pointer if not erased. More...
 
T * release ()
 Returns pointer. I won't take care of it any longer. More...
 
void erase ()
 
bool setIfNull (T *p)
 
T * createIfNull (PointerCreator=createSingleObject< T >)
 

Protected Types

typedef void(* PtrFunc) (T *)
 

Protected Member Functions

 PtrManBase (PtrFunc setfunc, PtrFunc deletor, T *)
 
virtual ~PtrManBase ()
 

Protected Attributes

Threads::AtomicPointer< T > ptr_
 
PtrFunc setfunc_
 
PtrFunc deletefunc_
 

Detailed Description

template<class T>
class PtrManBase< T >

Base class for smart pointers. Don't use directly, use PtrMan, ArrPtrMan or RefMan instead.

Member Typedef Documentation

template<class T>
typedef T*(* PtrManBase< T >::PointerCreator) ()
template<class T>
typedef void(* PtrManBase< T >::PtrFunc) (T *)
protected

Constructor & Destructor Documentation

template<class T>
PtrManBase< T >::PtrManBase ( PtrFunc  setfunc,
PtrFunc  deletor,
T *  p 
)
inlineprotected
template<class T>
virtual PtrManBase< T >::~PtrManBase ( )
inlineprotectedvirtual

Member Function Documentation

template<class T >
T * PtrManBase< T >::createIfNull ( PointerCreator  creator = createSingleObject<T>)
inline

If null, PointerCrator will be called to create new object.

template<class T>
void PtrManBase< T >::erase ( )
inline
template<class T>
bool PtrManBase< T >::operator! ( ) const
inline
template<class T>
T* PtrManBase< T >::release ( )
inline

Returns pointer. I won't take care of it any longer.

template<class T>
T * PtrManBase< T >::set ( T *  p,
bool  doerase = true 
)
inline

Returns old pointer if not erased.

template<class T>
bool PtrManBase< T >::setIfNull ( T *  p)
inline

Member Data Documentation

template<class T>
PtrFunc PtrManBase< T >::deletefunc_
protected
template<class T>
Threads::AtomicPointer<T> PtrManBase< T >::ptr_
protected
template<class T>
PtrFunc PtrManBase< T >::setfunc_
protected

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B. V. 2019