CS::DataBuffer< Allocator > Class Template Reference
This is an implementation of iDataBuffer interface. More...
#include <csutil/databuf.h>
Inheritance diagram for CS::DataBuffer< Allocator >:

Public Member Functions | |
DataBuffer (iDataBuffer *source) | |
Duplicate an existing data buffer. Also appends a 0 char. | |
DataBuffer (char *iData, size_t iSize, bool should_delete=true) | |
Construct an data buffer object given a existing pointer. | |
DataBuffer (size_t iSize, const Allocator &alloc) | |
Construct an preallocated data buffer (filled with garbage initially). | |
DataBuffer (size_t iSize) | |
Construct an preallocated data buffer (filled with garbage initially). | |
virtual char * | GetData () const |
Get the buffer as an abstract pointer. | |
bool | GetDeleteOnDestruct () const |
Return true if this databuffer will destroy its memory on destruction. | |
virtual size_t | GetSize () const |
Query the buffer size. | |
virtual | ~DataBuffer () |
Destroy (free) the buffer. |
Detailed Description
template<class Allocator = Memory::AllocatorMalloc>
class CS::DataBuffer< Allocator >
This is an implementation of iDataBuffer interface.
The object is extremely lightweight and is recommended for use in plugins as a mean to transparently exchange abstract data between plugins.
Definition at line 41 of file databuf.h.
Constructor & Destructor Documentation
CS::DataBuffer< Allocator >::DataBuffer | ( | size_t | iSize | ) | [inline] |
Construct an preallocated data buffer (filled with garbage initially).
Definition at line 53 of file databuf.h.
References CS::Memory::AllocatorPointerWrapper< T, Allocator >::p.
CS::DataBuffer< Allocator >::DataBuffer | ( | size_t | iSize, | |
const Allocator & | alloc | |||
) | [inline] |
Construct an preallocated data buffer (filled with garbage initially).
Definition at line 60 of file databuf.h.
References CS::Memory::AllocatorPointerWrapper< T, Allocator >::p.
CS::DataBuffer< Allocator >::DataBuffer | ( | char * | iData, | |
size_t | iSize, | |||
bool | should_delete = true | |||
) | [inline] |
Construct an data buffer object given a existing pointer.
The pointer must be allocated by an allocator compatible to the given.
Definition at line 72 of file databuf.h.
References CS::Memory::AllocatorPointerWrapper< T, Allocator >::p.
CS::DataBuffer< Allocator >::DataBuffer | ( | iDataBuffer< Allocator > * | source | ) | [inline] |
Duplicate an existing data buffer. Also appends a 0 char.
Definition at line 80 of file databuf.h.
References iDataBuffer::GetData(), and CS::Memory::AllocatorPointerWrapper< T, Allocator >::p.
virtual CS::DataBuffer< Allocator >::~DataBuffer | ( | ) | [inline, virtual] |
Destroy (free) the buffer.
Definition at line 90 of file databuf.h.
References CS::Memory::AllocatorPointerWrapper< T, Allocator >::p.
Member Function Documentation
virtual char* CS::DataBuffer< Allocator >::GetData | ( | ) | const [inline, virtual] |
Get the buffer as an abstract pointer.
Definition at line 101 of file databuf.h.
References CS::Memory::AllocatorPointerWrapper< T, Allocator >::p.
bool CS::DataBuffer< Allocator >::GetDeleteOnDestruct | ( | ) | const [inline] |
virtual size_t CS::DataBuffer< Allocator >::GetSize | ( | ) | const [inline, virtual] |
The documentation for this class was generated from the following file:
- csutil/databuf.h
Generated for Crystal Space 1.2 by doxygen 1.4.7