The container to store control messages. More...
#include "satellite-control-message.h"
Public Member Functions | |
| SatControlMsgContainer () | |
| Default constructor for SatControlMsgContainer. | |
| SatControlMsgContainer (Time m_storeTime, bool deleteOnRead) | |
| Default constructor for SatControlMsgContainer. | |
| ~SatControlMsgContainer () | |
| Destructor for SatControlMsgContainer. | |
| Ptr< SatControlMessage > | Read (uint32_t recvId) |
| Read a control message. | |
| uint32_t | ReserveIdAndStore (Ptr< SatControlMessage > controlMsg) |
| Reserve an id and store a control message. | |
| uint32_t | Send (uint32_t sendId) |
| Add a control message. | |
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. | |
| void | EraseFirst () |
| Erase first item from container. | |
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). | |
| uint32_t | m_recvId |
| ReservedCtrlMsgMap_t | m_reservedCtrlMsgs |
| uint32_t | m_sendId |
| Time | m_storeTime |
| Time to store a message in container. | |
| 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 1314 of file satellite-control-message.h.
|
private |
Definition at line 1371 of file satellite-control-message.h.
|
private |
Definition at line 1373 of file satellite-control-message.h.
|
private |
Definition at line 1372 of file satellite-control-message.h.
|
private |
Definition at line 1370 of file satellite-control-message.h.
| ns3::SatControlMsgContainer::SatControlMsgContainer | ( | ) |
Default constructor for SatControlMsgContainer.
Definition at line 1132 of file satellite-control-message.cc.
References m_deleteOnRead, m_recvId, m_sendId, and m_storeTime.
| ns3::SatControlMsgContainer::SatControlMsgContainer | ( | Time | m_storeTime, |
| bool | deleteOnRead ) |
Default constructor for SatControlMsgContainer.
Definition at line 1141 of file satellite-control-message.cc.
References m_deleteOnRead, m_recvId, m_sendId, and m_storeTime.
| ns3::SatControlMsgContainer::~SatControlMsgContainer | ( | ) |
Destructor for SatControlMsgContainer.
Definition at line 1151 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 1302 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 1280 of file satellite-control-message.cc.
References CleanUpIdMap(), EraseFirst(), m_ctrlMsgs, m_storeTime, and m_storeTimeout.
Referenced by EraseFirst(), 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 1237 of file satellite-control-message.cc.
References CleanUpIdMap(), EraseFirst(), m_ctrlMsgs, m_deleteOnRead, and m_storeTimeout.
Referenced by ns3::SatBeamHelper::NotifyConstructionCompleted().
| 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 1157 of file satellite-control-message.cc.
References m_reservedCtrlMsgs, and m_sendId.
Referenced by ns3::SatBeamHelper::NotifyConstructionCompleted().
| uint32_t ns3::SatControlMsgContainer::Send | ( | uint32_t | sendId | ) |
Add a control message.
| sendId | of the message to add. |
Definition at line 1172 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::NotifyConstructionCompleted().
|
private |
Definition at line 1377 of file satellite-control-message.h.
Referenced by CleanUpIdMap(), and Send().
|
private |
Definition at line 1376 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 1393 of file satellite-control-message.h.
Referenced by SatControlMsgContainer(), SatControlMsgContainer(), and Read().
|
private |
Definition at line 1379 of file satellite-control-message.h.
Referenced by SatControlMsgContainer(), SatControlMsgContainer(), and Send().
|
private |
Definition at line 1375 of file satellite-control-message.h.
Referenced by ReserveIdAndStore(), and Send().
|
private |
Definition at line 1378 of file satellite-control-message.h.
Referenced by SatControlMsgContainer(), SatControlMsgContainer(), and 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 1388 of file satellite-control-message.h.
Referenced by SatControlMsgContainer(), SatControlMsgContainer(), EraseFirst(), and Send().
|
private |
Definition at line 1380 of file satellite-control-message.h.
Referenced by EraseFirst(), Read(), and Send().