OpendTect  6.6
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

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

Protected Types

typedef void(* PtrFunc) (T *)
 

Protected Member Functions

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

Protected Attributes

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

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

◆ PointerCreator

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

◆ PtrFunc

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

Constructor & Destructor Documentation

◆ PtrManBase()

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

◆ ~PtrManBase()

template<class T >
virtual PtrManBase< T >::~PtrManBase ( )
inlineprotectedvirtual

Member Function Documentation

◆ createIfNull()

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

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

◆ erase()

template<class T >
void PtrManBase< T >::erase ( )
inline

◆ operator!()

template<class T >
bool PtrManBase< T >::operator! ( ) const
inline

◆ release()

template<class T >
T* PtrManBase< T >::release ( )
inline

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

◆ set()

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

Returns old pointer if not erased.

◆ setIfNull() [1/2]

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

◆ setIfNull() [2/2]

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

If takeover==true, pointer will be deleted if object was not set.

Member Data Documentation

◆ deletefunc_

template<class T >
PtrFunc PtrManBase< T >::deletefunc_
protected

◆ ptr_

template<class T >
Threads::AtomicPointer<T> PtrManBase< T >::ptr_
protected

◆ setfunc_

template<class T >
PtrFunc PtrManBase< T >::setfunc_
protected

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