Public Types | |
typedef DWORD | BufferSize |
Public Member Functions | |
virtual BufferSize | GetUsed () const =0 |
Returns how much space has been used in the buffer. That is, the current position of the insertion point. | |
virtual BufferSize | GetSize () const =0 |
Returns the size of the buffer. | |
virtual BufferSize | GetSpace () const =0 |
Returns the amount of free space immediately usable in the buffer. This is the same as GetSize() - GetUsed() but does not take into account any potential space at the front of the buffer that has been created by Consume(). | |
virtual const BYTE * | GetMemory () const =0 |
Returns a pointer to the bytes in the buffer. | |
virtual void | AddData (const char *pData, BufferSize dataLength)=0 |
Adds data to the buffer at the current insertion point and moves the insertion point forward by the amount of data added. Throws an exception if there isn't enough space left in the buffer to add all of the data. | |
virtual void | AddData (const BYTE *pData, BufferSize dataLength)=0 |
Adds data to the buffer at the current insertion point and moves the insertion point forward by the amount of data added. Throws an exception if there isn't enough space left in the buffer to add all of the data. | |
virtual void | AddData (BYTE data)=0 |
Adds data to the buffer at the current insertion point and moves the insertion point forward by the amount of data added. Throws an exception if there isn't enough space left in the buffer to add all of the data. | |
virtual bool | AddAsMuchAsPossible (const BYTE *pData, DWORD dataLength, DWORD &bytesAdded)=0 |
virtual void | Use (BufferSize dataUsed)=0 |
Move the insertion point without adding any data. Adds 'dataUsed' to the current insertion point. | |
virtual bool | ReduceUsed (BufferSize notUsed)=0 |
Move the insertion point 'back' thus removing bytes from the end of the buffer. Returns true if the buffer is now empty. | |
virtual void | Empty ()=0 |
Move the insertion point to the start of the buffer; thus emptying it. | |
DWORD | GetOverlappedResult (HANDLE handle) |
Calls GetOverlappedResult() on this OVERLAPPED for the supplied HANDLE and returns the number of bytes transferred. Throws an exception on failure. | |
DWORD | GetOverlappedResult (SOCKET socket) |
Calls GetOverlappedResult() on this OVERLAPPED for the supplied SOCKET and returns the number of bytes transferred. Throws an exception on failure. | |
Protected Member Functions | |
virtual | ~IBufferBase () |
We never delete instances of this interface; you must manage the lifetime of the class that implements it. |
typedef DWORD BufferSize |
virtual ~IBufferBase | ( | ) | [protected, virtual] |
We never delete instances of this interface; you must manage the lifetime of the class that implements it.
virtual BufferSize GetUsed | ( | ) | const [pure virtual] |
Returns how much space has been used in the buffer. That is, the current position of the insertion point.
virtual BufferSize GetSize | ( | ) | const [pure virtual] |
Returns the size of the buffer.
virtual BufferSize GetSpace | ( | ) | const [pure virtual] |
virtual const BYTE* GetMemory | ( | ) | const [pure virtual] |
Returns a pointer to the bytes in the buffer.
virtual void AddData | ( | const char * | pData, | |
BufferSize | dataLength | |||
) | [pure virtual] |
Adds data to the buffer at the current insertion point and moves the insertion point forward by the amount of data added. Throws an exception if there isn't enough space left in the buffer to add all of the data.
virtual void AddData | ( | const BYTE * | pData, | |
BufferSize | dataLength | |||
) | [pure virtual] |
Adds data to the buffer at the current insertion point and moves the insertion point forward by the amount of data added. Throws an exception if there isn't enough space left in the buffer to add all of the data.
virtual void AddData | ( | BYTE | data | ) | [pure virtual] |
Adds data to the buffer at the current insertion point and moves the insertion point forward by the amount of data added. Throws an exception if there isn't enough space left in the buffer to add all of the data.
virtual bool AddAsMuchAsPossible | ( | const BYTE * | pData, | |
DWORD | dataLength, | |||
DWORD & | bytesAdded | |||
) | [pure virtual] |
virtual void Use | ( | BufferSize | dataUsed | ) | [pure virtual] |
Move the insertion point without adding any data. Adds 'dataUsed' to the current insertion point.
virtual bool ReduceUsed | ( | BufferSize | notUsed | ) | [pure virtual] |
Move the insertion point 'back' thus removing bytes from the end of the buffer. Returns true if the buffer is now empty.
virtual void Empty | ( | ) | [pure virtual] |
Move the insertion point to the start of the buffer; thus emptying it.
Calls GetOverlappedResult() on this OVERLAPPED for the supplied HANDLE and returns the number of bytes transferred. Throws an exception on failure.
Calls GetOverlappedResult() on this OVERLAPPED for the supplied SOCKET and returns the number of bytes transferred. Throws an exception on failure.