DynObjHolder< T > Struct Template Reference
[Templates for DynI and friends]

#include <DynObjHolder.hpp>

List of all members.

Public Member Functions

 DynObjHolder (T *pdo, HoldMode mode)
DynObjHolderAssign (T *pdo, HoldMode mode)
T * Get () const
T & operator() () const
T & operator* () const
T * operator-> () const
bool operator! () const
DynObjHolderoperator= (T *pdo)
bool IsOk () const
void Release ()

Protected Attributes

union {
   T *   m_pdo
}; 
HoldMode m_mode


Detailed Description

template<class T>
struct DynObjHolder< T >

NOTE: Deprecated. This "all-purpose" class has been replaced by more lightweight classes: ScopedDynObj<T> DynWeakRef<T> RefCntDynObjPtr<T>

Holds a DynI (or derived type) and releases/destroyes it when holder goes out of scope. It is practical for handling local DynObj:s. By default it takes over a DynObj in the constructor. Alternatively it can create a new object from a library.

Parameters:
T The type of object to hold

Constructor & Destructor Documentation

template<class T>
DynObjHolder< T >::DynObjHolder ( T *  pdo,
HoldMode  mode 
) [inline]

Different two argument constructor.

Parameters:
pdo is a pointer to an existing DynObj to take over.
mode determines how the object is released


Member Function Documentation

template<class T>
DynObjHolder& DynObjHolder< T >::Assign ( T *  pdo,
HoldMode  mode 
) [inline]

Assign a new DynObj to holder. For a given mode, it will check that the object being held supports the requested way of holding. If it fails, an error is logged gloablly.

Parameters:
pdo is a pointer to an existing DynObj to take over.
mode determines how the object is release.

template<class T>
T* DynObjHolder< T >::Get (  )  const [inline]

Get a pointer to the held object.

template<class T>
T& DynObjHolder< T >::operator() (  )  const [inline]

Get a reference to the held object.

template<class T>
T* DynObjHolder< T >::operator-> (  )  const [inline]

Get a pointer to the held object.

template<class T>
bool DynObjHolder< T >::operator! (  )  const [inline]

Operator! (test if NULL object held)

template<class T>
DynObjHolder& DynObjHolder< T >::operator= ( T *  pdo  )  [inline]

Assign a new DynObj to this holder.

template<class T>
bool DynObjHolder< T >::IsOk (  )  const [inline]

Return true if we are holding an object.

template<class T>
void DynObjHolder< T >::Release (  )  [inline]

Release currently held object


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

Generated on Sun Feb 15 16:35:57 2009 for DynObj by  doxygen 1.5.6