cpp-msgpack-light 0.3.0
A light library to serialize MessagePack.
Loading...
Searching...
No Matches
msgpack_light::memory_output_stream Class Referencefinal

Class of streams to write data to memory. More...

#include <msgpack_light/memory_output_stream.h>

Inheritance diagram for msgpack_light::memory_output_stream:
Collaboration diagram for msgpack_light::memory_output_stream:

Public Member Functions

 memory_output_stream ()
 Constructor.
const binaryas_binary () const
 Get the data as msgpack_light::binary instance.
void clear ()
 Clear data.
const unsigned char * data () const noexcept
 Get the pointer to the written data.
std::size_t size () const noexcept
 Get the size of the written data.
void write (const unsigned char *data, std::size_t size) override
 Write data.
Public Member Functions inherited from msgpack_light::output_stream
 output_stream ()=default
 Constructor.

Private Attributes

binary buffer_ {}
 Buffer.

Static Private Attributes

static constexpr std::size_t initial_buffer_size = 4096U
 Size of the initial buffer.

Additional Inherited Members

Protected Member Functions inherited from msgpack_light::output_stream
 output_stream (const output_stream &)=default
 Copy constructor.
 output_stream (output_stream &&)=default
 Move constructor.
 ~output_stream ()=default
 Destructor.
output_streamoperator= (const output_stream &)=default
 Copy assignment operator.
output_streamoperator= (output_stream &&)=default
 Move assignment operator.

Detailed Description

Class of streams to write data to memory.

Definition at line 33 of file memory_output_stream.h.

Constructor & Destructor Documentation

◆ memory_output_stream()

msgpack_light::memory_output_stream::memory_output_stream ( )
inline

Constructor.

Definition at line 38 of file memory_output_stream.h.

Member Function Documentation

◆ as_binary()

const binary & msgpack_light::memory_output_stream::as_binary ( ) const
inlinenodiscard

Get the data as msgpack_light::binary instance.

Returns
Data.

Definition at line 76 of file memory_output_stream.h.

◆ clear()

void msgpack_light::memory_output_stream::clear ( )
inline

Clear data.

Definition at line 53 of file memory_output_stream.h.

◆ data()

const unsigned char * msgpack_light::memory_output_stream::data ( ) const
inlinenodiscardnoexcept

Get the pointer to the written data.

Returns
Pointer to the written data.

Definition at line 60 of file memory_output_stream.h.

◆ size()

std::size_t msgpack_light::memory_output_stream::size ( ) const
inlinenodiscardnoexcept

Get the size of the written data.

Returns
Size of the written data.

Definition at line 69 of file memory_output_stream.h.

◆ write()

void msgpack_light::memory_output_stream::write ( const unsigned char * data,
std::size_t size )
inlineoverridevirtual

Write data.

Parameters
[in]dataPointer to the data.
[in]sizeSize of the data.

Implements msgpack_light::output_stream.

Definition at line 46 of file memory_output_stream.h.

Member Data Documentation

◆ buffer_

binary msgpack_light::memory_output_stream::buffer_ {}
private

Buffer.

Definition at line 85 of file memory_output_stream.h.

◆ initial_buffer_size

std::size_t msgpack_light::memory_output_stream::initial_buffer_size = 4096U
staticconstexprprivate

Size of the initial buffer.

Definition at line 80 of file memory_output_stream.h.


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