A Discrete-Event Network Simulator
API
ns3::SerializationWrapper Class Reference

Class for the serialization-deserialization of the messagess to send in packets. More...

#include "serializationwrapper.h"

+ Inheritance diagram for ns3::SerializationWrapper:
+ Collaboration diagram for ns3::SerializationWrapper:

Public Member Functions

 SerializationWrapper ()
 Default constructor. More...
 
 SerializationWrapper (protomessage::ProtoPacket message)
 Constructor with argument. More...
 
virtual ~SerializationWrapper ()
 
virtual uint32_t Deserialize (Buffer::Iterator start)
 deserialize the data More...
 
void GetData (protomessage::ProtoPacket *message)
 Getter of the data in the protocol header. More...
 
virtual TypeId GetInstanceTypeId (void) const
 
virtual uint32_t GetSerializedSize (void) const
 compute the serialized size of the data More...
 
virtual void Print (std::ostream &os) const
 dummy printing of the serialized data More...
 
virtual void Serialize (Buffer::Iterator start) const
 serialize the data More...
 
void SetData (protomessage::ProtoPacket message)
 Setter of the data in the protocol header. More...
 

Static Public Member Functions

static TypeId GetTypeId (void)
 Register this type. More...
 

Public Attributes

uint8_t * m_data
 the serialized data More...
 
int m_dataSize = 0
 holds the size of the serialized data in bytes More...
 

Detailed Description

Class for the serialization-deserialization of the messagess to send in packets.

Definition at line 54 of file serializationwrapper.h.

Constructor & Destructor Documentation

◆ SerializationWrapper() [1/2]

ns3::SerializationWrapper::SerializationWrapper ( )

Default constructor.

Definition at line 47 of file serializationwrapper.cc.

◆ ~SerializationWrapper()

ns3::SerializationWrapper::~SerializationWrapper ( )
virtual

Definition at line 51 of file serializationwrapper.cc.

◆ SerializationWrapper() [2/2]

ns3::SerializationWrapper::SerializationWrapper ( protomessage::ProtoPacket  message)

Constructor with argument.

Parameters
[in]messagethe protobuff object containing the data to transmit

Definition at line 85 of file serializationwrapper.cc.

References SetData().

+ Here is the call graph for this function:

Member Function Documentation

◆ Deserialize()

uint32_t ns3::SerializationWrapper::Deserialize ( Buffer::Iterator  start)
virtual

deserialize the data

Parameters
[in,out]startan iterator which points to where the data should read from.
Returns
the number of bytes read.

Definition at line 110 of file serializationwrapper.cc.

References m_data, and m_dataSize.

◆ GetData()

void ns3::SerializationWrapper::GetData ( protomessage::ProtoPacket message)

Getter of the data in the protocol header.

Parameters
[in,out]messagepointer to the protobuff object for storing data

Definition at line 78 of file serializationwrapper.cc.

References m_data, and m_dataSize.

Referenced by ns3::SensorNode::ReceivePacket(), and ns3::Sink::ReceivePacket().

+ Here is the caller graph for this function:

◆ GetInstanceTypeId()

TypeId ns3::SerializationWrapper::GetInstanceTypeId ( void  ) const
virtual
Returns
The object TypeId.

Definition at line 42 of file serializationwrapper.cc.

References GetTypeId().

+ Here is the call graph for this function:

◆ GetSerializedSize()

uint32_t ns3::SerializationWrapper::GetSerializedSize ( void  ) const
virtual

compute the serialized size of the data

Returns
return the size of the serialized data in bytes

Definition at line 91 of file serializationwrapper.cc.

References m_dataSize.

◆ GetTypeId()

TypeId ns3::SerializationWrapper::GetTypeId ( void  )
static

Register this type.

Returns
The object TypeId.

Definition at line 31 of file serializationwrapper.cc.

Referenced by GetInstanceTypeId().

+ Here is the caller graph for this function:

◆ Print()

void ns3::SerializationWrapper::Print ( std::ostream &  os) const
virtual

dummy printing of the serialized data

Definition at line 129 of file serializationwrapper.cc.

◆ Serialize()

void ns3::SerializationWrapper::Serialize ( Buffer::Iterator  start) const
virtual

serialize the data

Parameters
[in,out]startan iterator which points to where the data should be written.

Definition at line 102 of file serializationwrapper.cc.

References m_data, and m_dataSize.

◆ SetData()

void ns3::SerializationWrapper::SetData ( protomessage::ProtoPacket  message)

Setter of the data in the protocol header.

Parameters
[in]messagethe protobuff object containing the data to transmit

Definition at line 58 of file serializationwrapper.cc.

References protomessage::ProtoPacket::ByteSizeLong(), m_data, and m_dataSize.

Referenced by ns3::SensorNode::ReceivePacket(), and SerializationWrapper().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_data

uint8_t* ns3::SerializationWrapper::m_data

the serialized data

Definition at line 142 of file serializationwrapper.h.

Referenced by Deserialize(), GetData(), Serialize(), and SetData().

◆ m_dataSize

int ns3::SerializationWrapper::m_dataSize = 0

holds the size of the serialized data in bytes

Definition at line 140 of file serializationwrapper.h.

Referenced by Deserialize(), GetData(), GetSerializedSize(), Serialize(), and SetData().


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