Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

_Handle Class Reference

Handle/Body: Base for Handle classes manipuating a Body. More...

#include <_Handle.h>

Inheritance diagram for _Handle:

_DHandle< _Tp > List of all members.

Public Member Functions

 _Handle ()
 _Handle (_Body *body_r)
 _Handle (const _Handle &rhs)
_Handleoperator= (_Body *rhs)
_Handleoperator= (const _Handle &rhs)
virtual ~_Handle ()
 operator const void * () const
_Bodyoperator-> ()
const _Bodyoperator-> () const
_Bodyoperator * ()
const _Bodyoperator * () const
virtual std::ostream & dumpOn (std::ostream &str) const

Static Private Member Functions

static void * operator new (size_t)

Private Attributes

_Body_body

Detailed Description

Handle/Body: Base for Handle classes manipuating a Body.

_Handle provides the basic methods to access and manipulate a _Body (reference counted representation class). It maintains the _Body reference counter on construction, assignment and deletion of the _Handle. It provides operator-> and operator* to access the _Body.

As real life representation class will be derived from _Body, real life handles will be derived from _Handle. For convenience the template class _DHandle is provided. It realizes the handle to a specific Body class.

 struct DataRep : public _Body {
   void baa() {}
 };

 class VarAccess {
   private:
     _DHandle<DataTypeRep> _rep;
   public:
     void baa() { return _rep->baa(); }
 };

 class PtrAccess : _DHandle<DataRep> {
 };

 VarAccess v;
 v.baa();

 PtrAccess p;
 p->baa();
 (*p).baa();
 


Constructor & Destructor Documentation

_Handle::_Handle  )  [inline]
 

Constructor.

_Handle::_Handle _Body body_r  )  [inline]
 

Constructor.

_Handle::_Handle const _Handle rhs  )  [inline]
 

CopyConstructor.

virtual _Handle::~_Handle  )  [inline, virtual]
 

Destructor.


Member Function Documentation

virtual std::ostream& _Handle::dumpOn std::ostream &  str  )  const [virtual]
 

Derived classes may overload this to realize std::ostream & operator<< for _Handle classes.

const _Body& _Handle::operator *  )  const [inline]
 

Const access _body.

_Body& _Handle::operator *  )  [inline]
 

Access _body.

_Handle::operator const void *  )  const [inline]
 

Test for _body.

static void* _Handle::operator new size_t   )  [static, private]
 

const _Body* _Handle::operator->  )  const [inline]
 

Forward const access to _body.

Reimplemented in _DHandle< _Tp >, and _DHandle< _D >.

_Body* _Handle::operator->  )  [inline]
 

Forward access to _body.

Reimplemented in _DHandle< _Tp >, and _DHandle< _D >.

_Handle& _Handle::operator= const _Handle rhs  )  [inline]
 

Assignment.

_Handle& _Handle::operator= _Body rhs  )  [inline]
 

Assignment.


Member Data Documentation

_Body* _Handle::_body [private]
 

The _Body


The documentation for this class was generated from the following file:
Generated on Mon Mar 21 16:25:28 2005 for liby2util by  doxygen 1.4.1