#include <StrMod/BufferChunk.h>
Inheritance diagram for strmod::strmod::BufferChunk:

Public Methods | |
| BufferChunk () | |
| As a convenience, initialize the protected variables maintained by the derived classes. | |
| virtual | ~BufferChunk () |
| Doesn't delete any storage whatsoever. | |
| 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 |
| This should ALWAYS return true. It says whether the class invariant holds or not. | |
| virtual void | printState (std::ostream &os) const |
| virtual unsigned int | Length () const |
| Number of octets this chunk takes up. May be deprecated. | |
| U1Byte & | operator[] (unsigned int bnum) |
| Returns a reference to the byte at index bnum. | |
| void * | getVoidP () |
| Gets a void pointer to at least Length() bytes of data. | |
| U1Byte * | getCharP () |
Gets a U1Byte pointer to at least Length() bytes of data. | |
| 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. | |
| virtual void | acceptVisitor (ChunkVisitor &visitor) throw (ChunkVisitor::halt_visitation) |
| Accept a ChunkVisitor, and maybe lead it through your children. | |
Protected Attributes | |
| void * | buf_ |
buf_ is expected to be maintained by the derived class. | |
| unsigned int | buflen_ |
buflen_ is expected to be maintained by the derived class. | |
Definition at line 46 of file BufferChunk.h.
|
|
Doesn't delete any storage whatsoever. Since this is an abstract class that doesn't ever actually allocate any storage, it's left to the derived classes to do the actual deletion. Definition at line 63 of file BufferChunk.h. |
|
|
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.
Reimplemented from strmod::lcore::Debugable. Reimplemented in strmod::strmod::DynamicBuffer, and strmod::strmod::PreAllocBufferBase. Definition at line 134 of file BufferChunk.h. |
|
|
Gets a This guarantees that you can read or write to any byte in the valid range using this pointer as long as you make no calls to resize() in between accesses. Definition at line 154 of file BufferChunk.h. |
|
|
Gets a void pointer to at least Length() bytes of data. This guarantees that you can read or write to any byte in the valid range using this pointer as long as you make no calls to resize() in between accesses. Definition at line 149 of file BufferChunk.h. |
|
|
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::lcore::Debugable. Reimplemented in strmod::strmod::DynamicBuffer, and strmod::strmod::PreAllocBufferBase. Definition at line 101 of file BufferChunk.h. |
|
|
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. Implements strmod::lcore::Debugable. Reimplemented in strmod::strmod::PreAllocBufferBase, strmod::strmod::PreAllocBuffer< TInitialAlloc >, and strmod::strmod::PreAllocBuffer< 48 >. Definition at line 139 of file BufferChunk.h. |
|
|
Returns a reference to the byte at index bnum. If bnum is out of range, the behavior is undefined. Definition at line 144 of file BufferChunk.h. |
|
|
Change the size of the chunk to newsize. Throws bad_alloc if the allocation fails, just like operator new. Implemented in strmod::strmod::DynamicBuffer, strmod::strmod::PreAllocBufferBase, strmod::strmod::PreAllocBuffer< TInitialAlloc >, and strmod::strmod::PreAllocBuffer< 48 >. |
|
|
This exists so that the above inline functions are truly inline. It's only allowed to change in the constructor, or in respone to the resize() method being called.
Definition at line 115 of file BufferChunk.h. |
|
|
This exist so that the above inline functions are truly inline. It's only allowed to change in the constructor, or in respone to the resize() method being called. Definition at line 122 of file BufferChunk.h. |
|
|
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::lcore::Debugable. Reimplemented in strmod::strmod::DynamicBuffer, and strmod::strmod::PreAllocBufferBase. |
1.3-rc1