Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

HBCI::PointerBase Class Reference

Base class for the smart pointer template class. More...

#include <pointer.h>

Inheritance diagram for HBCI::PointerBase:

Inheritance graph
[legend]
List of all members.

Public Methods

virtual ~PointerBase ()
void setDescription (string descr)
const string & description () const
void setObjectDescription (string descr)
string objectDescription () const
virtual int refCount () const
bool operator== (const PointerBase &p) const
bool sharingData (const PointerBase &p) const
bool operator!= (const PointerBase &p) const
virtual void * voidptr () const
void setAutoDelete (bool b)
bool isValid () const

Detailed Description

Base class for the smart pointer template class.

This is the base class to be inherited by a template class. This cannot be used directly.

Author:
Martin Preuss<openhbci@aquamaniac.de>


Constructor & Destructor Documentation

virtual HBCI::PointerBase::~PointerBase   [inline, virtual]
 

Destructor. If this one gets called, it automagically decrements the usage counter of the object pointed to. If it reaches zero, then no other pointer points to the object and the object faces deletion.

Author:
Martin Preuss<openhbci@aquamaniac.de>


Member Function Documentation

const string& HBCI::PointerBase::description   const [inline]
 

Get the description of this pointer.

Useful for debugging purposes.

Author:
Martin Preuss<martin@libchipcard.de>

bool HBCI::PointerBase::isValid   const [inline]
 

Returns true if this Pointer is valid.

This tells you if this pointer is pointing to accessible data.

Author:
Martin Preuss<openhbci@aquamaniac.de>
Returns :
true if data is accessible, false if no data

string HBCI::PointerBase::objectDescription   const [inline]
 

Returns the description of the object.

Useful for debugging purposes.

Author:
Martin Preuss<martin@libchipcard.de>

bool HBCI::PointerBase::operator!= const PointerBase &    p const [inline]
 

Inequality operator for the object pointed to.

This operator checks whether another pointer and this one are not pointing to the same data.

Author:
Martin Preuss<openhbci@aquamaniac.de>

bool HBCI::PointerBase::operator== const PointerBase &    p const [inline]
 

Equality operator for the object pointed to.

This operator checks whether another pointer and this one are pointing to the same data.

Author:
Martin Preuss<openhbci@aquamaniac.de>

virtual int HBCI::PointerBase::refCount   const [inline, virtual]
 

Reimplemented in HBCI::Pointer< T >, HBCI::Pointer< ProgressMonitor >, HBCI::Pointer< Loader >, HBCI::Pointer< Medium >, HBCI::Pointer< Job >, HBCI::Pointer< JOBDialogInit >, HBCI::Pointer< Auth >, HBCI::Pointer< MessageQueue >, HBCI::Pointer< JOBGetStatusReport >, HBCI::Pointer< Customer >, HBCI::Pointer< Outbox >, HBCI::Pointer< User >, HBCI::Pointer< Account >, HBCI::Pointer< Bank >, and HBCI::Pointer< Interactor >.

void HBCI::PointerBase::setAutoDelete bool    b [inline]
 

Set the auto-deletion behaviour.

Set the auto-deletion behaviour of the PointerObject (the wrapper object around the "real" object pointed to) that is pointed to by this Pointer.

By default, this is set to setAutoDeletion(true), i.e. the object will automatically be deleted when its last HBCI::Pointer gets deleted. On the other hand, when you call this with b=false, then the object this pointer points to will not be deleted by the last HBCI::Pointer.

This might be useful if you are pointing to constant objects, or if you need to continue using this object through raw pointers elsewhere.

This flag is a property of the PointerObject, i.e. even for multiple HBCI::Pointer's pointing to the same object there is only *one* autoDelete flag per object. Changes to this flag affect all of the HBCI::Pointer's at the same time.

This HBCI::Pointer MUST already point to an object (a NULL pointer is not allowed at this point) since the autodelete flag is a property of the class PointerObject. If called on an invalid HBCI::Pointer, this method will throw an HBCI::Error.

Parameters:
b  True to set automatic deletion to be enabled, false to disable it.
Author:
Martin Preuss<openhbci@aquamaniac.de>

void HBCI::PointerBase::setDescription string    descr [inline]
 

Set the description of this pointer.

Useful for debugging purposes.

Author:
Martin Preuss<martin@libchipcard.de>

void HBCI::PointerBase::setObjectDescription string    descr [inline]
 

Set the description of the object this pointer points to.

Useful for debugging purposes.

Author:
Martin Preuss<martin@libchipcard.de>

bool HBCI::PointerBase::sharingData const PointerBase &    p const [inline]
 

Checks whether both pointers share their data object.

Author:
Martin Preuss<openhbci@aquamaniac.de>

virtual void* HBCI::PointerBase::voidptr   const [inline, virtual]
 

Returns a raw pointer to the stored data.

You should not really use this, but if you do so please NEVER delete the object the pointer points to ! AND you should make sure that as long as you are using the pointer returned there is still a Pointer pointing to it (because if the last Pointer stops pointing to an object that object gets deleted) !!

Author:
Martin Preuss<openhbci@aquamaniac.de>


The documentation for this class was generated from the following file:
Generated on Mon Jun 23 13:41:17 2003 for openhbci by doxygen1.2.17