cpp-msgpack-rpc 0.2.0
An RPC library implementing MessagePack RPC.
Loading...
Searching...
No Matches
msgpack_rpc::messages::SerializedMessage Class Reference

Class of serialized message data. More...

#include <msgpack_rpc/messages/serialized_message.h>

Collaboration diagram for msgpack_rpc::messages::SerializedMessage:

Public Member Functions

 SerializedMessage (const char *data, std::size_t size)
 Constructor.
 SerializedMessage (const SerializedMessage &other) noexcept
 Copy constructor.
 SerializedMessage (impl::SharableBinaryHeader *buffer)
 Constructor.
 SerializedMessage (SerializedMessage &&other) noexcept
 Move constructor.
 ~SerializedMessage () noexcept
 Destructor.
const char * data () const noexcept
 Get the pointer to the data.
SerializedMessageoperator= (const SerializedMessage &other) noexcept
 Copy assignment operator.
SerializedMessageoperator= (SerializedMessage &&other) noexcept
 Move assignment operator.
std::size_t size () const noexcept
 Get the size of the data.

Private Attributes

impl::SharableBinaryHeaderbuffer_
 Buffer.

Detailed Description

Class of serialized message data.

Note
Objects of this class shares internal buffers for the same data.

Definition at line 34 of file serialized_message.h.

Constructor & Destructor Documentation

◆ SerializedMessage() [1/4]

msgpack_rpc::messages::SerializedMessage::SerializedMessage ( const char * data,
std::size_t size )

Constructor.

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

Definition at line 30 of file serialized_message.cpp.

◆ SerializedMessage() [2/4]

msgpack_rpc::messages::SerializedMessage::SerializedMessage ( impl::SharableBinaryHeader * buffer)
explicit

Constructor.

Parameters
[in]bufferBuffer.
Warning
Users must not use this constructor.

Definition at line 37 of file serialized_message.cpp.

◆ SerializedMessage() [3/4]

msgpack_rpc::messages::SerializedMessage::SerializedMessage ( const SerializedMessage & other)
noexcept

Copy constructor.

Parameters
[in]otherObject to copy from.

Definition at line 40 of file serialized_message.cpp.

◆ SerializedMessage() [4/4]

msgpack_rpc::messages::SerializedMessage::SerializedMessage ( SerializedMessage && other)
noexcept

Move constructor.

Parameters
[in,out]otherObject to move from.

Definition at line 45 of file serialized_message.cpp.

◆ ~SerializedMessage()

msgpack_rpc::messages::SerializedMessage::~SerializedMessage ( )
noexcept

Destructor.

Definition at line 67 of file serialized_message.cpp.

Member Function Documentation

◆ data()

const char * msgpack_rpc::messages::SerializedMessage::data ( ) const
nodiscardnoexcept

Get the pointer to the data.

Returns
Pointer to the data.

Definition at line 73 of file serialized_message.cpp.

◆ operator=() [1/2]

SerializedMessage & msgpack_rpc::messages::SerializedMessage::operator= ( const SerializedMessage & other)
noexcept

Copy assignment operator.

Parameters
[in]otherObject to copy from.
Returns
This object after copy.

Definition at line 48 of file serialized_message.cpp.

◆ operator=() [2/2]

SerializedMessage & msgpack_rpc::messages::SerializedMessage::operator= ( SerializedMessage && other)
noexcept

Move assignment operator.

Parameters
[in,out]otherObject to move from.
Returns
This object after move.

Definition at line 61 of file serialized_message.cpp.

◆ size()

std::size_t msgpack_rpc::messages::SerializedMessage::size ( ) const
nodiscardnoexcept

Get the size of the data.

Returns
Size of the data.

Definition at line 77 of file serialized_message.cpp.

Member Data Documentation

◆ buffer_

impl::SharableBinaryHeader* msgpack_rpc::messages::SerializedMessage::buffer_
private

Buffer.

Definition at line 104 of file serialized_message.h.


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