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

oofSharedBLOB Class Reference
[OOFILE utility classes and functions.]

#include <oofStruct.h>

Inheritance diagram for oofSharedBLOB:

Inheritance graph
[legend]
Collaboration diagram for oofSharedBLOB:

Collaboration graph
[legend]
List of all members.

Detailed Description

Store a shared chunk of binary info with reference count to avoid copying.

Implements mDirty flag to mark for updates. Implements mLoaded flag to use when subclassing or in a context where want to differentiate between not being loaded and having loaded a zero-size BLOB. Use as a pointer member, copying the pointer and calling incRefs or decRefs each time you copy the pointer or destruct the oofSharedBLOB.

Todo:
write oofSharedCOWBLOB providing quick duplication for COW. (Copy-On-Write).


Public Member Functions

 oofSharedBLOB ()
 oofSharedBLOB (const oofSharedBLOB &)
virtual ~oofSharedBLOB ()
bool isDirty () const
bool isLoaded () const
unsigned long bodyLength () const
char * bodyAddress () const
void reset ()
char * allocRoomFor (unsigned long)
char * orphanBody ()
void adoptBody (char *body, unsigned long bodyLen)
void markDirty ()
void setLen (unsigned long newLen)
 Truncate length.

void setBytes (const char *buf, unsigned long bufLen)
void incRefs ()
void decRefs ()

Protected Attributes

char * mBody
unsigned long mBodyLength
bool mDirty
bool mLoaded
unsigned int mReferences


Constructor & Destructor Documentation

oofSharedBLOB::oofSharedBLOB  ) 
 

oofSharedBLOB::oofSharedBLOB const oofSharedBLOB  ) 
 

oofSharedBLOB::~oofSharedBLOB  )  [virtual]
 


Member Function Documentation

void oofSharedBLOB::adoptBody char *  body,
unsigned long  bodyLen
 

char * oofSharedBLOB::allocRoomFor unsigned  long  ) 
 

char * oofSharedBLOB::bodyAddress  )  const [inline]
 

unsigned long oofSharedBLOB::bodyLength  )  const [inline]
 

void OOF_mixRefCount::decRefs  )  [inherited]
 

void OOF_mixRefCount::incRefs  )  [inline, inherited]
 

bool oofSharedBLOB::isDirty  )  const [inline]
 

bool oofSharedBLOB::isLoaded  )  const [inline]
 

void oofSharedBLOB::markDirty  )  [inline]
 

char * oofSharedBLOB::orphanBody  ) 
 

void oofSharedBLOB::reset  )  [inline]
 

void oofSharedBLOB::setBytes const char *  buf,
unsigned long  bufLen
 

void oofSharedBLOB::setLen unsigned long  newLen  ) 
 

Truncate length.

Asserts if incoming length too long.


Member Data Documentation

char* oofSharedBLOB::mBody [protected]
 

unsigned long oofSharedBLOB::mBodyLength [protected]
 

bool oofSharedBLOB::mDirty [protected]
 

bool oofSharedBLOB::mLoaded [protected]
 

unsigned int OOF_mixRefCount::mReferences [protected, inherited]
 


The documentation for this class was generated from the following files:
Generated on Thu Jan 1 22:03:19 2004 for OOFILE by doxygen 1.3.5