The container to store control messages. More...
#include "satellite-control-message.h"
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< SatControlMessage > | Read (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_t > | CtrlMsgMap_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 |
The container to store control messages.
Container assigns two sequences of IDs for added messages.
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 1392 of file satellite-control-message.h.
|
private |
Definition at line 1449 of file satellite-control-message.h.
|
private |
Definition at line 1451 of file satellite-control-message.h.
|
private |
Definition at line 1450 of file satellite-control-message.h.
|
private |
Definition at line 1448 of file satellite-control-message.h.
ns3::SatControlMsgContainer::SatControlMsgContainer | ( | ) |
Default constructor for SatControlMsgContainer.
Definition at line 1236 of file satellite-control-message.cc.
ns3::SatControlMsgContainer::SatControlMsgContainer | ( | Time | m_storeTime, |
bool | deleteOnRead | ||
) |
Default constructor for SatControlMsgContainer.
Definition at line 1245 of file satellite-control-message.cc.
ns3::SatControlMsgContainer::~SatControlMsgContainer | ( | ) |
Destructor for SatControlMsgContainer.
Definition at line 1255 of file satellite-control-message.cc.
|
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.
recvId | Ctrl msg id |
Definition at line 1406 of file satellite-control-message.cc.
References m_ctrlIdMap.
Referenced by EraseFirst(), and Read().
|
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 1384 of file satellite-control-message.cc.
References CleanUpIdMap(), m_ctrlMsgs, m_storeTime, and m_storeTimeout.
Referenced by Read(), and Send().
Ptr< SatControlMessage > ns3::SatControlMsgContainer::Read | ( | uint32_t | recvId | ) |
Read a control message.
recvId | Id of the message to read. |
Definition at line 1341 of file satellite-control-message.cc.
References CleanUpIdMap(), EraseFirst(), m_ctrlMsgs, m_deleteOnRead, and m_storeTimeout.
Referenced by ns3::SatBeamHelper::SatBeamHelper().
uint32_t ns3::SatControlMsgContainer::ReserveIdAndStore | ( | Ptr< SatControlMessage > | controlMsg | ) |
Reserve an id and store a control message.
controlMsg | Pointer to message to be added. |
Definition at line 1261 of file satellite-control-message.cc.
References m_reservedCtrlMsgs, and m_sendId.
Referenced by ns3::SatBeamHelper::SatBeamHelper().
uint32_t ns3::SatControlMsgContainer::Send | ( | uint32_t | sendId | ) |
Add a control message.
sendId | of the message to add. |
Definition at line 1276 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().
|
private |
Definition at line 1455 of file satellite-control-message.h.
Referenced by CleanUpIdMap(), and Send().
|
private |
Definition at line 1454 of file satellite-control-message.h.
Referenced by EraseFirst(), Read(), and Send().
|
private |
Flag to tell, if message is deleted from container when read (get).
Definition at line 1471 of file satellite-control-message.h.
Referenced by Read().
|
private |
Definition at line 1457 of file satellite-control-message.h.
Referenced by Send().
|
private |
Definition at line 1453 of file satellite-control-message.h.
Referenced by ReserveIdAndStore(), and Send().
|
private |
Definition at line 1456 of file satellite-control-message.h.
Referenced by ReserveIdAndStore().
|
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 1466 of file satellite-control-message.h.
Referenced by EraseFirst(), and Send().
|
private |
Definition at line 1458 of file satellite-control-message.h.
Referenced by EraseFirst(), Read(), and Send().