EMANE  1.2.1
EMANE::Controls::SerializedControlMessage Class Reference

A Serialized Control Message is used to encapsulate Serializable control messages as they traverse process boundaries via a network connection. More...

#include <serializedcontrolmessage.h>

Inheritance diagram for EMANE::Controls::SerializedControlMessage:
EMANE::ControlMessage EMANE::Serializable EMANE::Cloneable< ControlMessage >

Public Types

enum  { IDENTIFIER = EMANE_CONTROL_MEASSGE_SERIALIZED }
 

Public Member Functions

SerializedControlMessageclone () const override
 
 ~SerializedControlMessage ()
 
ControlMessageId getSerializedId () const
 
std::string getSerialization () const
 
ControlMessageId getId () const
 
virtual Serialization serialize () const
 

Static Public Member Functions

static SerializedControlMessagecreate (ControlMessageId id, const void *pData, size_t length)
 

Detailed Description

A Serialized Control Message is used to encapsulate Serializable control messages as they traverse process boundaries via a network connection.

Note
Instances are immutable

Encapulated control messages must be restored before use:

{
const auto pSerializedControlMessage =
static_cast<const Controls::SerializedControlMessage *>(pMessage);
switch(pSerializedControlMessage->getSerializedId())
{
{
std::unique_ptr<Controls::FlowControlControlMessage>
pFlowControlControlMessage{
Controls::FlowControlControlMessage::create(pSerializedControlMessage->getSerialization())};
if(bFlowControlEnable_)
{
flowControlManager_.processFlowControlMessage(pFlowControlControlMessage.get());
}
else
{
LOGGER_STANDARD_LOGGING(pPlatformService_->logService(),
"MACI %03hu %s::%s received a flow control token request but"
" flow control is not enabled",
id_,
pzLayerName,
__func__);
}
}
break;
}
}

Definition at line 57 of file serializedcontrolmessage.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
IDENTIFIER 

Definition at line 109 of file serializedcontrolmessage.h.

Constructor & Destructor Documentation

◆ ~SerializedControlMessage()

EMANE::Controls::SerializedControlMessage::~SerializedControlMessage ( )

Destroys an instance

Definition at line 74 of file serializedcontrolmessage.cc.

Member Function Documentation

◆ clone()

EMANE::Controls::SerializedControlMessage * EMANE::Controls::SerializedControlMessage::clone ( ) const
overridevirtual

Clones the control message on the heap

Returns
cloned message
Note
Caller assumes ownership of the clone

Implements EMANE::Cloneable< ControlMessage >.

Definition at line 98 of file serializedcontrolmessage.cc.

◆ create()

EMANE::Controls::SerializedControlMessage * EMANE::Controls::SerializedControlMessage::create ( ControlMessageId  id,
const void *  pData,
size_t  length 
)
static

Creates a SerializedControlMessage instance on the heap

Parameters
idControl message id of the message being serialized
pDataPointer to the serialized data
lengthSerialized data length
Note
Once a control message is passed to another NEM layer using EMANE::UpstreamTransport::processUpstreamPacket(), EMANE::UpstreamTransport::processUpstreamControl(), EMANE::DownstreamTransport::processDownstreamPacket() or EMANE::DownstreamTransport::processDownstreamControl() object ownership is transferred to the emulator infrastructure along with deallocation responsibility. It is not valid to use a control message instance after it has been passed to another layer.

Definition at line 90 of file serializedcontrolmessage.cc.

◆ getId()

ControlMessageId EMANE::ControlMessage::getId ( ) const
inlineinherited

Gets the control message id

Returns
control messase id

Definition at line 64 of file controlmessage.h.

◆ getSerialization()

std::string EMANE::Controls::SerializedControlMessage::getSerialization ( ) const

Gets the message serialization

Returns
serialization

Definition at line 83 of file serializedcontrolmessage.cc.

◆ getSerializedId()

EMANE::ControlMessageId EMANE::Controls::SerializedControlMessage::getSerializedId ( ) const

Gets the control message id of the serialized message

Returns
control message id

Definition at line 77 of file serializedcontrolmessage.cc.

◆ serialize()


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