GenericMemoryBuffer< Allocator > Struct Template Reference#
Public Types |
Public Member Functions |
Public Attributes |
Static Public Attributes |
List of all members
GenericMemoryBuffer< Allocator > Struct Template Reference
Represents an in-memory output byte stream. More...
#include <memorybuffer.h>
Public Types | |
typedef char | Ch |
Public Member Functions | |
GenericMemoryBuffer (Allocator *allocator=0, size_t capacity=kDefaultCapacity) | |
void | Put (Ch c) |
void | Flush () |
void | Clear () |
void | ShrinkToFit () |
Ch * | Push (size_t count) |
void | Pop (size_t count) |
const Ch * | GetBuffer () const |
size_t | GetSize () const |
Public Attributes | |
internal::Stack< Allocator > | stack_ |
Static Public Attributes | |
static const size_t | kDefaultCapacity = 256 |
Detailed Description
template<typename Allocator = CrtAllocator>
struct GenericMemoryBuffer< Allocator >
Represents an in-memory output byte stream.
This class is mainly for being wrapped by EncodedOutputStream or AutoUTFOutputStream.
It is similar to FileWriteBuffer but the destination is an in-memory buffer instead of a file.
Differences between MemoryBuffer and StringBuffer:
- StringBuffer has Encoding but MemoryBuffer is only a byte buffer.
- StringBuffer::GetString() returns a null-terminated string. MemoryBuffer::GetBuffer() returns a buffer without terminator.
- Template Parameters
-
Allocator type for allocating memory buffer.
- Note
- implements Stream concept
Member Typedef Documentation
◆ Ch
template<typename Allocator = CrtAllocator>
typedef char GenericMemoryBuffer< Allocator >::Ch |
Constructor & Destructor Documentation
◆ GenericMemoryBuffer()
template<typename Allocator = CrtAllocator>
|
inline |
Member Function Documentation
◆ Clear()
template<typename Allocator = CrtAllocator>
|
inline |
◆ Flush()
template<typename Allocator = CrtAllocator>
|
inline |
◆ GetBuffer()
template<typename Allocator = CrtAllocator>
|
inline |
◆ GetSize()
template<typename Allocator = CrtAllocator>
|
inline |
◆ Pop()
template<typename Allocator = CrtAllocator>
|
inline |
◆ Push()
template<typename Allocator = CrtAllocator>
|
inline |
◆ Put()
template<typename Allocator = CrtAllocator>
|
inline |
◆ ShrinkToFit()
template<typename Allocator = CrtAllocator>
|
inline |
Member Data Documentation
◆ kDefaultCapacity
template<typename Allocator = CrtAllocator>
|
static |
◆ stack_
template<typename Allocator = CrtAllocator>
|
mutable |
The documentation for this struct was generated from the following files:
- /home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-composable-kernel/checkouts/develop/include/rapidjson/fwd.h
- /home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-composable-kernel/checkouts/develop/include/rapidjson/memorybuffer.h