ns3::SatControlMsgContainer Class Reference

The container to store control messages. More...

#include "satellite-control-message.h"

+ Inheritance diagram for ns3::SatControlMsgContainer:
+ Collaboration diagram for ns3::SatControlMsgContainer:

Public Member Functions

 SatControlMsgContainer ()
 Default constructor for SatControlMsgContainer. More...
 
 SatControlMsgContainer (Time m_storeTime, bool deleteOnRead)
 Default constructor for SatControlMsgContainer. More...
 
 ~SatControlMsgContainer ()
 Destructor for SatControlMsgContainer. More...
 
Ptr< SatControlMessageRead (uint32_t recvId)
 Read a control message. More...
 
uint32_t ReserveIdAndStore (Ptr< SatControlMessage > controlMsg)
 Reserve an id and store a control message. More...
 
uint32_t Send (uint32_t sendId)
 Add a control message. More...
 

Private Types

typedef std::map< uint32_t, uint32_t > CtrlIdMap_t
 
typedef std::map< uint32_t, CtrlMsgMapValue_tCtrlMsgMap_t
 
typedef std::pair< Time, Ptr< SatControlMessage > > CtrlMsgMapValue_t
 
typedef std::map< uint32_t, Ptr< SatControlMessage > > ReservedCtrlMsgMap_t
 

Private Member Functions

void CleanUpIdMap (uint32_t recvId)
 Do clean up for the Ctrl msg id map. More...
 
void EraseFirst ()
 Erase first item from container. More...
 

Private Attributes

CtrlIdMap_t m_ctrlIdMap
 
CtrlMsgMap_t m_ctrlMsgs
 
bool m_deleteOnRead
 Flag to tell, if message is deleted from container when read (get). More...
 
uint32_t m_recvId
 
ReservedCtrlMsgMap_t m_reservedCtrlMsgs
 
uint32_t m_sendId
 
Time m_storeTime
 Time to store a message in container. More...
 
EventId m_storeTimeout
 

Detailed Description

The container to store control messages.

Container assigns two sequences of IDs for added messages.

  • Send/buffered IDs - used during buffering period between ND and MAC.
  • Receive IDs - used to indicate the receiver the id for the control PDU

Message are deleted after set store time expired for a message. Message is deleted already when read, if this functionality is enabled in creation time.

Container is needed to store control messages which content are not wanted to simulate inside packet.

The reason for two sets of IDs relate to two things:

Definition at line 1346 of file satellite-control-message.h.

Member Typedef Documentation

◆ CtrlIdMap_t

typedef std::map<uint32_t, uint32_t> ns3::SatControlMsgContainer::CtrlIdMap_t
private

Definition at line 1403 of file satellite-control-message.h.

◆ CtrlMsgMap_t

typedef std::map<uint32_t, CtrlMsgMapValue_t> ns3::SatControlMsgContainer::CtrlMsgMap_t
private

Definition at line 1405 of file satellite-control-message.h.

◆ CtrlMsgMapValue_t

typedef std::pair<Time, Ptr<SatControlMessage> > ns3::SatControlMsgContainer::CtrlMsgMapValue_t
private

Definition at line 1404 of file satellite-control-message.h.

◆ ReservedCtrlMsgMap_t

typedef std::map<uint32_t, Ptr<SatControlMessage> > ns3::SatControlMsgContainer::ReservedCtrlMsgMap_t
private

Definition at line 1402 of file satellite-control-message.h.

Constructor & Destructor Documentation

◆ SatControlMsgContainer() [1/2]

ns3::SatControlMsgContainer::SatControlMsgContainer ( )

Default constructor for SatControlMsgContainer.

Definition at line 1190 of file satellite-control-message.cc.

◆ SatControlMsgContainer() [2/2]

ns3::SatControlMsgContainer::SatControlMsgContainer ( Time  m_storeTime,
bool  deleteOnRead 
)

Default constructor for SatControlMsgContainer.

Definition at line 1199 of file satellite-control-message.cc.

◆ ~SatControlMsgContainer()

ns3::SatControlMsgContainer::~SatControlMsgContainer ( )

Destructor for SatControlMsgContainer.

Definition at line 1209 of file satellite-control-message.cc.

Member Function Documentation

◆ CleanUpIdMap()

void ns3::SatControlMsgContainer::CleanUpIdMap ( uint32_t  recvId)
private

Do clean up for the Ctrl msg id map.

Currently it needs to erase a map entry based on value, which is not very efficient.

Parameters
recvIdCtrl msg id

Definition at line 1360 of file satellite-control-message.cc.

References m_ctrlIdMap.

Referenced by EraseFirst(), and Read().

+ Here is the caller graph for this function:

◆ EraseFirst()

void ns3::SatControlMsgContainer::EraseFirst ( )
private

Erase first item from container.

Schedules a new erase call to this function with time left for next item in list (if container is not empty).

Definition at line 1338 of file satellite-control-message.cc.

References CleanUpIdMap(), m_ctrlMsgs, m_storeTime, and m_storeTimeout.

Referenced by Read(), and Send().

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

◆ Read()

Ptr< SatControlMessage > ns3::SatControlMsgContainer::Read ( uint32_t  recvId)

Read a control message.

Parameters
recvIdId of the message to read.
Returns
Pointer to message.

Definition at line 1295 of file satellite-control-message.cc.

References CleanUpIdMap(), EraseFirst(), m_ctrlMsgs, m_deleteOnRead, and m_storeTimeout.

Referenced by ns3::SatBeamHelper::SatBeamHelper().

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

◆ ReserveIdAndStore()

uint32_t ns3::SatControlMsgContainer::ReserveIdAndStore ( Ptr< SatControlMessage controlMsg)

Reserve an id and store a control message.

Parameters
controlMsgPointer to message to be added.
Returns
Reserved send ID of the created added message.

Definition at line 1215 of file satellite-control-message.cc.

References m_reservedCtrlMsgs, and m_sendId.

Referenced by ns3::SatBeamHelper::SatBeamHelper().

+ Here is the caller graph for this function:

◆ Send()

uint32_t ns3::SatControlMsgContainer::Send ( uint32_t  sendId)

Add a control message.

Parameters
sendIdof the message to add.
Returns
Receive id given by the container.

Definition at line 1230 of file satellite-control-message.cc.

References EraseFirst(), m_ctrlIdMap, m_ctrlMsgs, m_recvId, m_reservedCtrlMsgs, m_storeTime, and m_storeTimeout.

Referenced by ns3::SatBeamHelper::SatBeamHelper().

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

Member Data Documentation

◆ m_ctrlIdMap

CtrlIdMap_t ns3::SatControlMsgContainer::m_ctrlIdMap
private

Definition at line 1409 of file satellite-control-message.h.

Referenced by CleanUpIdMap(), and Send().

◆ m_ctrlMsgs

CtrlMsgMap_t ns3::SatControlMsgContainer::m_ctrlMsgs
private

Definition at line 1408 of file satellite-control-message.h.

Referenced by EraseFirst(), Read(), and Send().

◆ m_deleteOnRead

bool ns3::SatControlMsgContainer::m_deleteOnRead
private

Flag to tell, if message is deleted from container when read (get).

Definition at line 1425 of file satellite-control-message.h.

Referenced by Read().

◆ m_recvId

uint32_t ns3::SatControlMsgContainer::m_recvId
private

Definition at line 1411 of file satellite-control-message.h.

Referenced by Send().

◆ m_reservedCtrlMsgs

ReservedCtrlMsgMap_t ns3::SatControlMsgContainer::m_reservedCtrlMsgs
private

Definition at line 1407 of file satellite-control-message.h.

Referenced by ReserveIdAndStore(), and Send().

◆ m_sendId

uint32_t ns3::SatControlMsgContainer::m_sendId
private

Definition at line 1410 of file satellite-control-message.h.

Referenced by ReserveIdAndStore().

◆ m_storeTime

Time ns3::SatControlMsgContainer::m_storeTime
private

Time to store a message in container.

If m_deleteOnRead is set false, the message is always deleted only when this time is elapsed.

Definition at line 1420 of file satellite-control-message.h.

Referenced by EraseFirst(), and Send().

◆ m_storeTimeout

EventId ns3::SatControlMsgContainer::m_storeTimeout
private

Definition at line 1412 of file satellite-control-message.h.

Referenced by EraseFirst(), Read(), and Send().


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