User Documentation
RAVL, Recognition And Vision Library
DEVELOP HOME PAGE CLASS LIST CONTENTS
Ravl - Core - Reference Counting - HandleRefCounterC
 

  PUBLIC
HandleRefCounterC::HandleRefCounterC(void)
HandleRefCounterC::HandleRefCounterC(const TriggerC &)
HandleRefCounterC::SetDestructionOp(const TriggerC &)
HandleRefCounterC::References(void) const
RCHandleC::operator =(const RCHandleC &)
RCHandleC::DeepCopy(UIntT) const
RCHandleC::operator ==(const RCHandleC &) const
RCHandleC::operator !=(const RCHandleC &) const
RCHandleC::Hash(void) const
RCHandleC::IsValid(void) const
RCHandleC::Invalidate(void)
RCHandleC::IsHandleType(const DT &) const
RCHandleC::CheckHandleType(const DT &) const
RCHandleC::References(void) const
RCHandleC::operator <<(ostream &,const RCHandleC &)
RCHandleC::operator >>(istream &,RCHandleC &)

   HandleRefCounterC   
 
Handle based reference counter.
 
include "Ravl/HandleRefCounter.hh"
User Level:Advanced
Library:RavlCore
In Scope:RavlN

Comments:
The class RefCounterC is a reference counter which should be always inherited if a class contains pointers to allocated memory and the memory is shared by several objects. All constructors, a destructor, and an assigment operator must be modified in such class. The destructor is not virtual, therefore the class should be inherited as private or protected.

The RefCounterC class allocates its own memory separately from the memory of the object.

Parent Classes: Derived Classes: Methods:
HandleRefCounterC()
Creates the reference counter.

HandleRefCounterC(const TriggerC & ntrig)
Creates the reference counter and initializes it.
'func' is triggered when references of the object reach 0.

void SetDestructionOp(const TriggerC & ntrig)
Set trigger to call on delete.

UIntT References() const
Returns the number of references to this object.

#include "Ravl/RefCounter.hh"
const RCHandleC<HandleRefCounterBodyC> & operator =(const RCHandleC<HandleRefCounterBodyC> & oth)
Assign handle.

RCHandleC<HandleRefCounterBodyC> DeepCopy(UIntT levels = ((UIntT))) const
Do a deep copy of the object.

bool operator ==(const RCHandleC<HandleRefCounterBodyC> & oth) const
Are handles to the same object ?

bool operator !=(const RCHandleC<HandleRefCounterBodyC> & oth) const
Are handles to different objects ?

UIntT Hash() const
Default hash function.
This hashes on the address of the body.

bool IsValid() const
Test if this is a valid handle.

void Invalidate()
Invalidate this handle.
Unattaches the body from the handle.

bool IsHandleType(const DT &) const
Is handle of given type ?

void CheckHandleType(const DT & dummy) const
Check handle type. Throw an expception if not.

UIntT References() const
Find the number of references to the body of this object.

ostream & operator <<(ostream & strm,const RCHandleC<HandleRefCounterBodyC> & obj)

istream & operator >>(istream & strm,RCHandleC<HandleRefCounterBodyC> & obj)


Maintainer:Charles Galambos, Documentation by CxxDoc: Tue Aug 13 09:59:02 2002