VR-Vantage 3.1 API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Public Attributes | Static Public Attributes
GenericMemoryBuffer< Allocator > Struct Template Reference

Represents an in-memory output byte stream. More...

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 ()
ChPush (size_t count)
void Pop (size_t count)
const ChGetBuffer () 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:

  1. StringBuffer has Encoding but MemoryBuffer is only a byte buffer.
  2. StringBuffer::GetString() returns a null-terminated string. MemoryBuffer::GetBuffer() returns a buffer without terminator.
Template Parameters
Allocatortype for allocating memory buffer.
Note
implements Stream concept

Member Typedef Documentation

template<typename Allocator = CrtAllocator>
typedef char GenericMemoryBuffer< Allocator >::Ch

Constructor & Destructor Documentation

template<typename Allocator = CrtAllocator>
GenericMemoryBuffer< Allocator >::GenericMemoryBuffer ( Allocator *  allocator = 0,
size_t  capacity = kDefaultCapacity 
)
inline

Member Function Documentation

template<typename Allocator = CrtAllocator>
void GenericMemoryBuffer< Allocator >::Put ( Ch  c)
inline
template<typename Allocator = CrtAllocator>
void GenericMemoryBuffer< Allocator >::Flush ( )
inline
template<typename Allocator = CrtAllocator>
void GenericMemoryBuffer< Allocator >::Clear ( )
inline
template<typename Allocator = CrtAllocator>
void GenericMemoryBuffer< Allocator >::ShrinkToFit ( )
inline
template<typename Allocator = CrtAllocator>
Ch* GenericMemoryBuffer< Allocator >::Push ( size_t  count)
inline
template<typename Allocator = CrtAllocator>
void GenericMemoryBuffer< Allocator >::Pop ( size_t  count)
inline
template<typename Allocator = CrtAllocator>
const Ch* GenericMemoryBuffer< Allocator >::GetBuffer ( ) const
inline
template<typename Allocator = CrtAllocator>
size_t GenericMemoryBuffer< Allocator >::GetSize ( ) const
inline

Member Data Documentation

template<typename Allocator = CrtAllocator>
const size_t GenericMemoryBuffer< Allocator >::kDefaultCapacity = 256
static
template<typename Allocator = CrtAllocator>
internal::Stack<Allocator> GenericMemoryBuffer< Allocator >::stack_
mutable

The documentation for this struct was generated from the following file:


Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)