g4tools  5.4.0
Public Member Functions | Protected Attributes | List of all members
tools::handle< T > Class Template Reference
Inheritance diagram for tools::handle< T >:
Inheritance graph
[legend]
Collaboration diagram for tools::handle< T >:
Collaboration graph
[legend]

Public Member Functions

virtual void * object () const
 
virtual base_handlecopy ()
 
virtual void disown ()
 
 handle (T *a_obj, bool a_owner=true)
 
 handle (const std::string &a_class, T *a_obj, bool a_owner=true)
 
virtual ~handle ()
 
- Public Member Functions inherited from tools::base_handle
 base_handle ()
 
 base_handle (const std::string &a_class)
 
virtual ~base_handle ()
 
const std::string & object_class () const
 

Protected Attributes

T * m_obj
 
bool m_owner
 

Additional Inherited Members

- Protected Member Functions inherited from tools::base_handle
 base_handle (base_handle &a_from)
 

Detailed Description

template<class T>
class tools::handle< T >

Definition at line 58 of file handle.

Constructor & Destructor Documentation

◆ handle() [1/2]

template<class T >
tools::handle< T >::handle ( T *  a_obj,
bool  a_owner = true 
)
inline

Definition at line 65 of file handle.

65 :parent(),m_obj(a_obj),m_owner(a_owner){}

◆ handle() [2/2]

template<class T >
tools::handle< T >::handle ( const std::string &  a_class,
T *  a_obj,
bool  a_owner = true 
)
inline

Definition at line 66 of file handle.

66 :parent(a_class),m_obj(a_obj),m_owner(a_owner){}

◆ ~handle()

template<class T >
virtual tools::handle< T >::~handle ( )
inlinevirtual

Definition at line 67 of file handle.

67 {if(m_owner) delete m_obj;}

Member Function Documentation

◆ copy()

template<class T >
virtual base_handle* tools::handle< T >::copy ( )
inlinevirtual

Implements tools::base_handle.

Definition at line 62 of file handle.

62 {return new handle<T>(*this);}

◆ disown()

template<class T >
virtual void tools::handle< T >::disown ( )
inlinevirtual

Implements tools::base_handle.

Definition at line 63 of file handle.

63 {m_owner = false;}

◆ object()

template<class T >
virtual void* tools::handle< T >::object ( ) const
inlinevirtual

Implements tools::base_handle.

Definition at line 61 of file handle.

61 {return m_obj;}

Member Data Documentation

◆ m_obj

template<class T >
T* tools::handle< T >::m_obj
protected

Definition at line 86 of file handle.

◆ m_owner

template<class T >
bool tools::handle< T >::m_owner
protected

Definition at line 87 of file handle.


The documentation for this class was generated from the following file:
tools::handle::m_obj
T * m_obj
Definition: handle:86
tools::handle::m_owner
bool m_owner
Definition: handle:87