strigi/src/streams
Strigi::StreamBuffer< T > Class Template Reference
Provides a buffer for the use of BufferedStream. More...
#include <streambuffer.h>

Public Member Functions | |
| StreamBuffer () | |
| ~StreamBuffer () | |
| int32_t | makeSpace (int32_t needed) |
| int32_t | read (const T *&start, int32_t max=0) |
| void | setSize (int32_t size) |
Public Attributes | |
| int32_t | avail |
| T * | readPos |
| int32_t | size |
| T * | start |
Detailed Description
template<class T>
class Strigi::StreamBuffer< T >
Provides a buffer for the use of BufferedStream.
For internal use only.
Definition at line 33 of file streambuffer.h.
Constructor & Destructor Documentation
| Strigi::StreamBuffer< T >::StreamBuffer | ( | ) | [inline] |
Constructor: initialises members to sane defaults.
For internal use only.
Definition at line 112 of file streambuffer.h.
| Strigi::StreamBuffer< T >::~StreamBuffer | ( | ) | [inline] |
Destructor: frees the memory used by the buffer.
For internal use only.
Definition at line 117 of file streambuffer.h.
Member Function Documentation
| int32_t Strigi::StreamBuffer< T >::makeSpace | ( | int32_t | needed | ) | [inline] |
Prepares the buffer for a new write.
For internal use only.
This function invalidates any pointers previously obtained from read.
- Returns:
- the number of available places
Definition at line 135 of file streambuffer.h.
| int32_t Strigi::StreamBuffer< T >::read | ( | const T *& | start, | |
| int32_t | max = 0 | |||
| ) | [inline] |
Read data from the buffer.
For internal use only.
Sets start to point to the data, starting at the item of data following the last item of data read.
- Parameters:
-
start pointer passed by reference. It will be set to point to the data read from the buffer max the maximum amount of data to read from the buffer
- Returns:
- the size of the data pointed to by
start(always less than or equal tomax)
Definition at line 168 of file streambuffer.h.
| void Strigi::StreamBuffer< T >::setSize | ( | int32_t | size | ) | [inline] |
Sets the size of the buffer, allocating the necessary memory.
For internal use only.
- Parameters:
-
size the size that the buffer should be, in multiples of sizeof(T)
Definition at line 122 of file streambuffer.h.
Member Data Documentation
| int32_t Strigi::StreamBuffer< T >::avail |
The amount of data available in the buffer.
For internal use only.
The size of the used memory in the buffer, starting from readPos. readPos + avail must be greater than start + size.
Definition at line 62 of file streambuffer.h.
| T* Strigi::StreamBuffer< T >::readPos |
Pointer to the current position the buffer.
For internal use only.
Definition at line 53 of file streambuffer.h.
| int32_t Strigi::StreamBuffer< T >::size |
Size of the buffer.
For internal use only.
Size of the memory pointed to by start, in multiples of sizeof(T)
Definition at line 48 of file streambuffer.h.
| T* Strigi::StreamBuffer< T >::start |
Pointer to the start of the buffer.
For internal use only.
Definition at line 40 of file streambuffer.h.
The documentation for this class was generated from the following file:
KDE 4.4 API Reference