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

strmod::strmod::PreAllocBufferBase Class Reference

Just a base class that defines the functions for the template class that don't depend on the template argument. More...

#include <StrMod/PreAllocBuffer.h>

Inheritance diagram for strmod::strmod::PreAllocBufferBase:

Inheritance graph
[legend]
List of all members.

Public Methods

virtual int AreYouA (const lcore::ClassIdent &cid) const
 Asks if a class is of a particular type, or publicly derived from that type.

virtual bool invariant () const=0
 This should ALWAYS return true. It says whether the class invariant holds or not.

virtual void printState (std::ostream &os) const=0
virtual void resize (unsigned int newsize)=0 throw (std::bad_alloc)
 Change the size of the chunk to newsize.


Static Public Attributes

const STR_ClassIdent identifier
 Globally unique identifier for this class.


Protected Methods

virtual const lcore::ClassIdent * i_GetIdent () const
 Returns the class identifier for the class the object actually is.

void i_destruct (const U1Byte *const preallocbuf)
void i_resize (const unsigned int newsize, const unsigned int prebufsize, U1Byte *const preallocbuf) throw (std::bad_alloc)
bool i_invariant (const unsigned int prebufsize, const void *const prebuf) const
void i_printState (std::ostream &os, const unsigned int prebufsize, const void *const prebuf) const

Detailed Description

Just a base class that defines the functions for the template class that don't depend on the template argument.

Definition at line 41 of file PreAllocBuffer.h.


Member Function Documentation

int strmod::strmod::PreAllocBufferBase::AreYouA const lcore::ClassIdent &    cid const [inline, virtual]
 

Asks if a class is of a particular type, or publicly derived from that type.

Overriden in every derived class (with a static identifier member) to compare against the identifier, then call the AreYouA methods of all the superclasses.

Parameters:
cid Usually <class>::identifier for the class you want to ask if the object is an instance of.

Reimplemented from strmod::strmod::BufferChunk.

Definition at line 105 of file PreAllocBuffer.h.

virtual const lcore::ClassIdent* strmod::strmod::PreAllocBufferBase::i_GetIdent   const [inline, protected, virtual]
 

Returns the class identifier for the class the object actually is.

Should always be overridden in any class that has a static identifier member.

Reimplemented from strmod::strmod::BufferChunk.

Definition at line 63 of file PreAllocBuffer.h.

virtual bool strmod::strmod::PreAllocBufferBase::invariant   const [pure virtual]
 

This should ALWAYS return true. It says whether the class invariant holds or not.

Your class invariant should be as strict as possible. The class invariant is used to detect when the class goes into a bad state, so all possible bad states should be caught by the invariant.

Reimplemented from strmod::strmod::BufferChunk.

Implemented in strmod::strmod::PreAllocBuffer< TInitialAlloc >, and strmod::strmod::PreAllocBuffer< 48 >.

virtual void strmod::strmod::PreAllocBufferBase::resize unsigned int    newsize throw (std::bad_alloc) [pure virtual]
 

Change the size of the chunk to newsize.

Throws bad_alloc if the allocation fails, just like operator new.

Implements strmod::strmod::BufferChunk.

Implemented in strmod::strmod::PreAllocBuffer< TInitialAlloc >, and strmod::strmod::PreAllocBuffer< 48 >.


Member Data Documentation

const STR_ClassIdent strmod::strmod::PreAllocBufferBase::identifier [static]
 

Globally unique identifier for this class.

Every class that might need to be identified should have a public static const identifier object in it.

Reimplemented from strmod::strmod::BufferChunk.


The documentation for this class was generated from the following files:
Generated on Wed Jan 29 00:32:54 2003 for libNet by doxygen1.3-rc1