DBus::Marshaling Class Reference

Implements the marshaling algorithms on a given vector of data. More...

#include <marshaling.h>

Public Member Functions

 Marshaling ()
 
 Marshaling (std::vector< uint8_t > *data, Endianess endian)
 Create a new Marshaling class that operates on the given vector of data, with the given endianess. More...
 
 ~Marshaling ()
 
void set_data (std::vector< uint8_t > *data)
 Set the data vector to marshal/demarshal. More...
 
void set_endianess (Endianess endian)
 
void marshal (bool v)
 
void marshal (uint8_t v)
 
void marshal (int16_t v)
 
void marshal (uint16_t v)
 
void marshal (int32_t v)
 
void marshal (uint32_t v)
 
void marshal (int64_t v)
 
void marshal (uint64_t v)
 
void marshal (double v)
 
void marshal (std::string v)
 
void marshal (Path v)
 
void marshal (Signature v)
 
void marshal (const Variant &v)
 
void align (int alignment)
 
void marshal_at_offset (uint32_t offset, uint32_t value)
 Marshal a uint32_t value at the given offset. More...
 
uint32_t currentOffset () const
 

Private Member Functions

void marshalShortBig (uint16_t toMarshal)
 
void marshalIntBig (uint32_t toMarshal)
 
void marshalLongBig (uint64_t toMarshal)
 
void marshalShortLittle (uint16_t toMarshal)
 
void marshalIntLittle (uint32_t toMarshal)
 
void marshalLongLittle (uint64_t toMarshal)
 

Private Attributes

std::shared_ptr< priv_data > m_priv
 

Detailed Description

Implements the marshaling algorithms on a given vector of data.

Note that all marshal() methods will always append to the given buffer.

Constructor & Destructor Documentation

◆ Marshaling() [1/2]

Marshaling::Marshaling ( )

References m_priv.

◆ Marshaling() [2/2]

Marshaling::Marshaling ( std::vector< uint8_t > *  data,
Endianess  endian 
)

Create a new Marshaling class that operates on the given vector of data, with the given endianess.

References m_priv.

◆ ~Marshaling()

Marshaling::~Marshaling ( )

Member Function Documentation

◆ align()

◆ currentOffset()

uint32_t Marshaling::currentOffset ( ) const

References m_priv.

◆ marshal() [1/13]

◆ marshal() [2/13]

◆ marshal() [3/13]

void Marshaling::marshal ( double  v)

◆ marshal() [4/13]

void Marshaling::marshal ( int16_t  v)

◆ marshal() [5/13]

void Marshaling::marshal ( int32_t  v)

◆ marshal() [6/13]

void Marshaling::marshal ( int64_t  v)

◆ marshal() [7/13]

void Marshaling::marshal ( Path  v)

References marshal().

◆ marshal() [8/13]

void Marshaling::marshal ( Signature  v)

References m_priv, and DBus::Signature::str().

◆ marshal() [9/13]

void Marshaling::marshal ( std::string  v)

References m_priv, and marshal().

◆ marshal() [10/13]

void Marshaling::marshal ( uint16_t  v)

◆ marshal() [11/13]

void Marshaling::marshal ( uint32_t  v)

◆ marshal() [12/13]

void Marshaling::marshal ( uint64_t  v)

◆ marshal() [13/13]

void Marshaling::marshal ( uint8_t  v)

References m_priv.

◆ marshal_at_offset()

void Marshaling::marshal_at_offset ( uint32_t  offset,
uint32_t  value 
)

Marshal a uint32_t value at the given offset.

This is only used to update the length of a marshaled array.

Parameters
offsetThe location to set the value
valueThe actual value to set.

References DBus::Little, and m_priv.

Referenced by DBus::Message::serialize_to_vector().

◆ marshalIntBig()

void Marshaling::marshalIntBig ( uint32_t  toMarshal)
private

References align(), and m_priv.

Referenced by marshal().

◆ marshalIntLittle()

void Marshaling::marshalIntLittle ( uint32_t  toMarshal)
private

References align(), and m_priv.

Referenced by marshal().

◆ marshalLongBig()

void Marshaling::marshalLongBig ( uint64_t  toMarshal)
private

References align(), and m_priv.

Referenced by marshal().

◆ marshalLongLittle()

void Marshaling::marshalLongLittle ( uint64_t  toMarshal)
private

References align(), and m_priv.

Referenced by marshal().

◆ marshalShortBig()

void Marshaling::marshalShortBig ( uint16_t  toMarshal)
private

References align(), and m_priv.

Referenced by marshal().

◆ marshalShortLittle()

void Marshaling::marshalShortLittle ( uint16_t  toMarshal)
private

References align(), and m_priv.

Referenced by marshal().

◆ set_data()

void Marshaling::set_data ( std::vector< uint8_t > *  data)

Set the data vector to marshal/demarshal.

Parameters
data

References m_priv.

◆ set_endianess()

void Marshaling::set_endianess ( Endianess  endian)

References m_priv.

Member Data Documentation

◆ m_priv


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