Mini application server API for C++.

 Overview   Project   Class   Tree   Deprecated   Index 
FRAMES    NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD

base
Class CzzHandle

   in zz_handle.h

template < class T > class CzzHandle

Template class used to keep track of objects allocated on the heap. Frees the wrapped object when handle goes out of scope. This class can't create objects allocated on the heap.

Author:
Toni Thomsson, toni@tonjac.org

Field Summary
protected CzzUseCounter* m_Counter
          Usage counter
protected T* m_Object
          Wrapped object
protected bool m_Vector
          Array?
 
Constructor Summary
CzzHandle( void )
          Create a empty handle
CzzHandle( const CzzHandle& handle )
          Copy constructor
CzzHandle( T* handle )
          Copy constructor
CzzHandle( T* obj, bool vector )
          Create a handle to a object allocated on the heap.
virtual ~CzzHandle()
          
 
Method Summary
 T* object( void )
          Object
 T* operator->()
          Object
 const CzzHandle& operator=( const CzzHandle& handle )
          Assignment
 T& ref( void )
          Reference
 operator T*( void )
          Object
 T value( void )
          Value of object pointer
 

Field Detail

m_Counter

protected CzzUseCounter* m_Counter;
Usage counter

m_Object

protected T* m_Object;
Wrapped object

m_Vector

protected bool m_Vector;
Array?


Constructor Detail

CzzHandle

public CzzHandle( void );
Create a empty handle

CzzHandle

public CzzHandle( const CzzHandle& handle );
Copy constructor

CzzHandle

public CzzHandle( T* handle );
Copy constructor

CzzHandle

public CzzHandle( T* obj, bool vector );
Create a handle to a object allocated on the heap. Sample:
       CzzHandle handle( new CxxObject[ 10 ], true );
       CzzHandle foo = new CxxFoo( 1, "kalle" );
       CzzHandle tmp;
       tmp = handle;
       tmp->callMethod( foo );
       doSomething( tmp );
       // No need to free objects, they are freed when the
       // handle goes out of scope
       
Parameters:
obj - Object
vector - Array

~CzzHandle

public virtual ~CzzHandle();


Method Detail

object

public T* object( void );
Object

operator->

public T* operator->();
Object

operator=

public const CzzHandle& operator=( const CzzHandle& handle );
Assignment

ref

public T& ref( void );
Reference

T*

public operator T*( void );
Object

value

public T value( void );
Value of object pointer

 Overview   Project   Class   Tree   Deprecated   Index 
FRAMES    NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD