Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

DbObject Class Reference

Definition of the DbObject class (generic persistable object). More...

#include <DbObject.h>

Inheritance diagram for DbObject:

DbDefObject List of all members.

Public Methods

void* operator new (size_t size, const DbTypeInfo& info)
 operator new for creation of transient objects. More...

void* operator new (size_t size, dbHandle<DbContainer>& cntHdl, const DbTypeInfo& info)
 operator new for the creation of persistent objects using clustering hint. More...

void* operator new (size_t size)
 operator new for purely heap based objects. More...

void operator delete (void* ptr)
 Need to overload operator delete after special instantiation. More...

void operator delete (void *ptr, const DbTypeInfo& info)
 Exception enabled compilation needs this delete operator. More...

void operator delete (void *ptr, dbHandle<DbContainer>& cntHdl, const DbTypeInfo& info)
 Exception enabled compilation needs this delete operator. More...

 DbObject ()
 Standard destructor. More...

long addRef ()
 Reference count: addRef. More...

long release ()
 Reference count: release. More...

virtual bool deleteObject ()
 Delete the object. More...

DbResult addAssocEntry (const std::string& db, const std::string& cnt, const std::string& obj, dbHandle<DbLink>& result)
 Add persistent association entry. More...

long addLink (const std::string& db, const std::string& cnt, const std::string& obj, const dbHandle<DbLink>& lnk)
 Add link to object. More...

long addInvalidLink ()
 add invalid link to object. More...

bool isPersistent () const
 Check if object is persistent. More...

long numLink () const
 Get total number of associated links. More...

dbVarray< dbHandle<DbLink> >& links ()
 Access leaf links. More...

const dbVarray< dbHandle<DbLink> >& links () const
 Access leaf links (CONST). More...

StreamBuffer& streamBuffer ()
 Access to streaming buffer of the object. More...

StreamBuffer& linkBuffer ()
 Access to streaming buffer of the associations. More...

long bufferSize () const
 Get the total length of data buffer. More...

long objSize () const
 Get the length of the object without the size of the link array. More...

void setObjSize (long length)
 Set the size of the object. More...

long linkSize () const
 Get the size of the link array. More...


Static Public Methods

long numInstances ()
 Statistics. More...

DbObject* create (void* buffer)
 Create method. More...


Protected Methods

unsigned char storageType () const
 Retrieve storage type. More...

virtual ~DbObject ()
 Persistent objects may ONLY be taken from the heap! More...


Protected Attributes

Internals m_internals

Static Protected Methods

void decreaseCounter ()
 Decrease statistics counter. More...

void increaseCounter ()
 Increase statistics counter. More...

void badAssignMessage ()
 Bad pointer assignment occured. Do printout for debugging puposes. More...


Private Attributes

friend DbPersistent
friend dbHandle<DbObject>
friend DbWrapper<DbObject>
friend DbFactory<DbObject>

Friends

class  DbObjectAccessor

Detailed Description

Definition of the DbObject class (generic persistable object).

Class: Object

Purpose: Basic object for storage of identifiable persistent data. The DbObject is able to keep track of persistent links between objects.

Dependencies:

History :

    +---------+----------------------------------------------+--------+
    |    Date |                 Comment                      | Who    |
    +---------+----------------------------------------------+--------+
    | 11/02/99| Initial version                              | MF     |
    +---------+----------------------------------------------+--------+
    

Author(s):
Markus Frank
Version:
1

Definition at line 61 of file DbObject.h.


Constructor & Destructor Documentation

DbObject::~DbObject ( ) [protected, virtual]
 

Persistent objects may ONLY be taken from the heap!

Definition at line 103 of file DbObject.cpp.

DbObject::DbObject ( )
 

Standard destructor.

Definition at line 98 of file DbObject.cpp.

Referenced by create().


Member Function Documentation

DbResult DbObject::addAssocEntry ( const std::string & db,
const std::string & cnt,
const std::string & obj,
dbHandle< DbLink >& to )
 

Add persistent association entry.

Definition at line 182 of file DbObject.cpp.

Referenced by addLink().

long DbObject::addInvalidLink ( )
 

add invalid link to object.

Definition at line 198 of file DbObject.cpp.

long DbObject::addLink ( const std::string & db,
const std::string & cnt,
const std::string & obj,
const dbHandle< DbLink >& to )
 

Add link to object.

Definition at line 188 of file DbObject.cpp.

long DbObject::addRef ( )
 

Reference count: addRef.

Definition at line 168 of file DbObject.cpp.

Referenced by DbObjectAccessor::switchPtr().

void DbObject::badAssignMessage ( ) [static, protected]
 

Bad pointer assignment occured. Do printout for debugging puposes.

Definition at line 204 of file DbObject.cpp.

Referenced by DbObjectAccessor::switchPtr().

long DbObject::bufferSize ( ) const
 

Get the total length of data buffer.

Definition at line 152 of file DbObject.cpp.

DbObject * DbObject::create ( void * buffer ) [static]
 

Create method.

Reimplemented in DbDefObject.

Definition at line 38 of file DbObject.cpp.

void DbObject::decreaseCounter ( ) [static, protected]
 

Decrease statistics counter.

Definition at line 107 of file DbObject.cpp.

Referenced by ~DbObject().

bool DbObject::deleteObject ( ) [virtual]
 

Delete the object.

Definition at line 84 of file DbObject.cpp.

void DbObject::increaseCounter ( ) [static, protected]
 

Increase statistics counter.

Definition at line 112 of file DbObject.cpp.

Referenced by DbObject().

bool DbObject::isPersistent ( ) const
 

Check if object is persistent.

Definition at line 132 of file DbObject.cpp.

StreamBuffer & DbObject::linkBuffer ( )
 

Access to streaming buffer of the associations.

Definition at line 122 of file DbObject.cpp.

long DbObject::linkSize ( ) const [inline]
 

Get the size of the link array.

Definition at line 135 of file DbObject.h.

const dbVarray< dbHandle< DbLink > >& DbObject::links ( ) const
 

Access leaf links (CONST).

Definition at line 147 of file DbObject.cpp.

dbVarray< dbHandle< DbLink > >& DbObject::links ( )
 

Access leaf links.

Definition at line 142 of file DbObject.cpp.

Referenced by addInvalidLink(), and addLink().

long DbObject::numInstances ( ) [static]
 

Statistics.

Definition at line 164 of file DbObject.cpp.

Referenced by DbCnvSvc::finalize().

long DbObject::numLink ( ) const
 

Get total number of associated links.

Definition at line 137 of file DbObject.cpp.

long DbObject::objSize ( ) const
 

Get the length of the object without the size of the link array.

Definition at line 156 of file DbObject.cpp.

void DbObject::operator delete ( void * ptr,
dbHandle< DbContainer >& cntHdl,
const DbTypeInfo & info )
 

Exception enabled compilation needs this delete operator.

Definition at line 79 of file DbObject.cpp.

void DbObject::operator delete ( void * ptr,
const DbTypeInfo & info )
 

Exception enabled compilation needs this delete operator.

Definition at line 74 of file DbObject.cpp.

void DbObject::operator delete ( void * ptr )
 

Need to overload operator delete after special instantiation.

Definition at line 62 of file DbObject.cpp.

Referenced by operator delete().

void * DbObject::operator new ( size_t size )
 

operator new for purely heap based objects.

Definition at line 49 of file DbObject.cpp.

void * DbObject::operator new ( size_t size,
dbHandle< DbContainer >& cntH,
const DbTypeInfo & type )
 

operator new for the creation of persistent objects using clustering hint.

Definition at line 55 of file DbObject.cpp.

void * DbObject::operator new ( size_t size,
const DbTypeInfo & type )
 

operator new for creation of transient objects.

Definition at line 43 of file DbObject.cpp.

long DbObject::release ( )
 

Reference count: release.

Definition at line 173 of file DbObject.cpp.

Referenced by DbObjectAccessor::switchPtr().

void DbObject::setObjSize ( long length )
 

Set the size of the object.

Definition at line 160 of file DbObject.cpp.

unsigned char DbObject::storageType ( ) const [protected]
 

Retrieve storage type.

Definition at line 127 of file DbObject.cpp.

Referenced by DbObjectAccessor::containedIn(), and DbObjectAccessor::switchPtr().

StreamBuffer & DbObject::streamBuffer ( )
 

Access to streaming buffer of the object.

Definition at line 117 of file DbObject.cpp.


Friends And Related Function Documentation

class DbObjectAccessor [friend]
 

Definition at line 64 of file DbObject.h.


Member Data Documentation

friend DbObject::DbFactory<DbObject> [private]
 

Definition at line 67 of file DbObject.h.

DbPersistent [private]
 

Reimplemented in DbDefObject.

Definition at line 63 of file DbObject.h.

friend DbObject::DbWrapper<DbObject> [private]
 

Definition at line 66 of file DbObject.h.

friend DbObject::dbHandle<DbObject> [private]
 

Definition at line 65 of file DbObject.h.

Internals DbObject::m_internals [mutable, protected]
 

Definition at line 74 of file DbObject.h.


The documentation for this class was generated from the following files:
Generated at Wed Nov 21 12:22:22 2001 by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000