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 1346 of file satellite-control-message.h.
|
private |
Definition at line 1403 of file satellite-control-message.h.
|
private |
Definition at line 1405 of file satellite-control-message.h.
|
private |
Definition at line 1404 of file satellite-control-message.h.
|
private |
Definition at line 1402 of file satellite-control-message.h.
ns3::SatControlMsgContainer::SatControlMsgContainer | ( | ) |
Default constructor for SatControlMsgContainer.
Definition at line 1190 of file satellite-control-message.cc.
ns3::SatControlMsgContainer::SatControlMsgContainer | ( | Time | m_storeTime, |
bool | deleteOnRead | ||
) |
Default constructor for SatControlMsgContainer.
Definition at line 1199 of file satellite-control-message.cc.
ns3::SatControlMsgContainer::~SatControlMsgContainer | ( | ) |
Destructor for SatControlMsgContainer.
Definition at line 1209 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 1360 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 1338 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 1295 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 1215 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 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().
|
private |
Definition at line 1409 of file satellite-control-message.h.
Referenced by CleanUpIdMap(), and Send().
|
private |
Definition at line 1408 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 1425 of file satellite-control-message.h.
Referenced by Read().
|
private |
Definition at line 1411 of file satellite-control-message.h.
Referenced by Send().
|
private |
Definition at line 1407 of file satellite-control-message.h.
Referenced by ReserveIdAndStore(), and Send().
|
private |
Definition at line 1410 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 1420 of file satellite-control-message.h.
Referenced by EraseFirst(), and Send().
|
private |
Definition at line 1412 of file satellite-control-message.h.
Referenced by EraseFirst(), Read(), and Send().