#include <DCDT_PostOffice.h>
Public Member Functions | |
DCDT_PostOffice (DCDT_Agora *agora, int type) | |
~DCDT_PostOffice () | |
void | AddMember (int Mem_ID) |
Adds a new user member to the PostOffice. | |
void | AddSysMember (int Mem_ID) |
Adds a new system member to the PostOffice. | |
void | DeleteMemberTableEntry (int Mem_ID) |
Delete a member from the PostOffice. | |
void | AddMsg (DCDT_Msg *MP, int Mem_ID, DCDT_RequestType Type) |
Add a new message to the PostOffice queue. | |
const DCDT_Msg * | ReadNextMsg (int MemID, bool wait) |
Read next message for the member MemID. | |
const DCDT_Msg * | ReadNextMsg (int MemID, int type, bool wait) |
Read next message of type type for the member MemID. | |
const DCDT_Msg * | ReadLastMsg (int MemID, int type, bool wait) |
Read the last message received of type type for the member MemID. | |
void | CleanupList () |
Called periodically by MsgManager. | |
void | SubscribeMsgTypeID (int Member_ID, int MsgType, DCDT_RequestType ReqType=DCDT_ALL_MSG) |
void | UnSubscribeMsgTypeID (int Member_ID, int MsgType, DCDT_RequestType ReqType=DCDT_ALL_MSG) |
Unsubscribe member Member_ID from the messages of type MsgType. | |
void | UnSubscribeAll (int Member_ID) |
Unsubscribe the member Member_ID from all the messages types. | |
bool | ReadSubscribedMsgMask (unsigned int *mask, int MemID) |
Check if SubscribedMsgMask ( used by LinkTx ) is changed. | |
bool | UpdateSubs (int MemID) |
Chech if the Suscribed mask for the member was changed. | |
void | SetActMsgDeletable (int Member_ID) |
Check if a message was read by all the member, if it is mark the message as deletable. | |
Private Member Functions | |
void | LogMsg (DCDT_Msg *msg) |
Log the message pointed by *msg. | |
Private Attributes | |
DCDT_Agora * | myAgora |
int | PO_Type |
DCDT_PostOffice_SLWBU * | PostOffice_SLWB |
DCDT_PostOffice_SLWDC * | PostOffice_SLWDC |
DCDT_PostOffice_SLWSM * | PostOffice_SLWSM |
Friends | |
class | DCDT_MsgManager |
class | DCDT_Agora |
NOTE: This class isn't a member of the Agorà, the real member that uses this class is DCDT_MsgManager.
Definition at line 94 of file DCDT_PostOffice.h.
|
Definition at line 33 of file DCDT_PostOffice.cpp. References myAgora, PO_Type, POSTOFFICE_SLWB, PostOffice_SLWB, POSTOFFICE_SLWDC, PostOffice_SLWDC, POSTOFFICE_SLWSM, and PostOffice_SLWSM. |
|
Definition at line 66 of file DCDT_PostOffice.cpp. |
|
Adds a new user member to the PostOffice. Enable an Agora' user member, idenfied by Mem_ID, to send and receive messages througth the PostOffice.
Definition at line 114 of file DCDT_PostOffice.cpp. References DCDT_PostOffice_SLWSM::AddMember(), DCDT_PostOffice_SLWDC::AddMember(), DCDT_PostOffice_SLWBU::AddMember(), PO_Type, PostOffice_SLWB, POSTOFFICE_SLWB, PostOffice_SLWDC, POSTOFFICE_SLWDC, PostOffice_SLWSM, and POSTOFFICE_SLWSM. Referenced by DCDT_Agora::AddMember(). |
|
Add a new message to the PostOffice queue. When the member Mem_ID wants to insert a new message the same member checks the subscription table and when a member is subscribed to those messages copy the message into the member message queue; this function also updates the message with the number of members subscribed to this message type.
Definition at line 191 of file DCDT_PostOffice.cpp. References DCDT_PostOffice_SLWSM::AddMsg(), DCDT_PostOffice_SLWDC::AddMsg(), DCDT_PostOffice_SLWBU::AddMsg(), DCDT_TRC_POSTOFFICE, LogMsg(), PO_Type, PostOffice_SLWB, POSTOFFICE_SLWB, PostOffice_SLWDC, POSTOFFICE_SLWDC, PostOffice_SLWSM, POSTOFFICE_SLWSM, and TRC_EXEC. Referenced by DCDT_Member::ShareMsg(). |
|
Adds a new system member to the PostOffice. Enable an Agora' system member, idenfied by Mem_ID, to send and receive messages througth the PostOffice.
Definition at line 139 of file DCDT_PostOffice.cpp. References DCDT_PostOffice_SLWSM::AddSysMember(), DCDT_PostOffice_SLWDC::AddSysMember(), DCDT_PostOffice_SLWBU::AddSysMember(), PO_Type, PostOffice_SLWB, POSTOFFICE_SLWB, PostOffice_SLWDC, POSTOFFICE_SLWDC, PostOffice_SLWSM, and POSTOFFICE_SLWSM. Referenced by DCDT_Agora::AddSysMember(). |
|
Called periodically by MsgManager.
Definition at line 323 of file DCDT_PostOffice.cpp. References DCDT_PostOffice_SLWSM::CleanupList(), DCDT_PostOffice_SLWDC::CleanupList(), DCDT_PostOffice_SLWBU::CleanupList(), PO_Type, PostOffice_SLWB, POSTOFFICE_SLWB, PostOffice_SLWDC, POSTOFFICE_SLWDC, PostOffice_SLWSM, and POSTOFFICE_SLWSM. Referenced by DCDT_MsgManager::DoYourJob(). |
|
Delete a member from the PostOffice. Disable an Agora' member, idenfied by Mem_ID, from sending and receiving messages througth the PostOffice.
Definition at line 164 of file DCDT_PostOffice.cpp. References DCDT_PostOffice_SLWSM::DeleteMemberTableEntry(), DCDT_PostOffice_SLWDC::DeleteMemberTableEntry(), DCDT_PostOffice_SLWBU::DeleteMemberTableEntry(), PO_Type, PostOffice_SLWB, POSTOFFICE_SLWB, PostOffice_SLWDC, POSTOFFICE_SLWDC, PostOffice_SLWSM, and POSTOFFICE_SLWSM. Referenced by DCDT_Agora::RemoveMember(). |
|
Log the message pointed by *msg.
Definition at line 81 of file DCDT_PostOffice.cpp. References DCDT_MsgHeader, DCDT_TRC_POSTOFFICE, DCDT_Msg::GetHeader(), DCDT_Msg::GetPayload(), DCDT_Msg::ReadPayloadLen(), DCDT_Msg::ReadType(), and TRC_PRINT. Referenced by AddMsg(), and ReadNextMsg(). |
|
Read the last message received of type type for the member MemID. Check if there is an unread message in the member queue; if we found one we have to mark it as deletable and return a pointer to it. If, during the queue slide, we find a message marked as deletable or that isn't the last one we have to delete it and go on.
Definition at line 297 of file DCDT_PostOffice.cpp. References PO_Type, PostOffice_SLWB, POSTOFFICE_SLWB, PostOffice_SLWDC, POSTOFFICE_SLWDC, PostOffice_SLWSM, POSTOFFICE_SLWSM, DCDT_PostOffice_SLWDC::ReadLastMsg(), DCDT_PostOffice_SLWBU::ReadLastMsg(), and DCDT_PostOffice_SLWSM::ReadNextMsg(). Referenced by DCDT_Member::ReceiveLastMsg(). |
|
Read next message of type type for the member MemID. Check if there is an unread message in the member queue; if we found one we have to mark it as deletable and return a pointer to it. If, during the queue slide, we find a message marked as deletable we have to delete it and go on.
Definition at line 269 of file DCDT_PostOffice.cpp. References PO_Type, PostOffice_SLWB, POSTOFFICE_SLWB, PostOffice_SLWDC, POSTOFFICE_SLWDC, PostOffice_SLWSM, POSTOFFICE_SLWSM, DCDT_PostOffice_SLWSM::ReadNextMsg(), DCDT_PostOffice_SLWDC::ReadNextMsg(), and DCDT_PostOffice_SLWBU::ReadNextMsg(). |
|
Read next message for the member MemID. Check if there is an unread message in the member queue; if we found one we have to mark it as deletable and return a pointer to it. If, during the queue slide, we find a message marked as deletable we have to delete it and go on.
Definition at line 224 of file DCDT_PostOffice.cpp. References DCDT_TRC_POSTOFFICE, LogMsg(), PO_Type, PostOffice_SLWB, POSTOFFICE_SLWB, PostOffice_SLWDC, POSTOFFICE_SLWDC, DCDT_PostOffice_SLWDC::ReadNextMsg(), DCDT_PostOffice_SLWBU::ReadNextMsg(), and TRC_EXEC. Referenced by DCDT_Member::ReceiveMsg(), and DCDT_Member::ReceiveMsgType(). |
|
Check if SubscribedMsgMask ( used by LinkTx ) is changed. The global mask is build upon the single message mask of each active member, the mask don't include the mask of the member MemID ( usually the calling member ); if MemID is a bridge all the members masks are used otherwise only the masks of MPM_USER and MPM_BRIDGE type members are used; so in a LinkTx member we can build the subscriber mask that needs to be passed to the other side of the link.
Definition at line 432 of file DCDT_PostOffice.cpp. References PO_Type, PostOffice_SLWB, POSTOFFICE_SLWB, PostOffice_SLWDC, POSTOFFICE_SLWDC, PostOffice_SLWSM, POSTOFFICE_SLWSM, DCDT_PostOffice_SLWSM::ReadSubscribedMsgMask(), DCDT_PostOffice_SLWDC::ReadSubscribedMsgMask(), and DCDT_PostOffice_SLWBU::ReadSubscribedMsgMask(). Referenced by DCDT_LinkTx::DoYourJob(). |
|
Check if a message was read by all the member, if it is mark the message as deletable.
Definition at line 317 of file DCDT_PostOffice.cpp. |
|
Definition at line 350 of file DCDT_PostOffice.cpp. References PO_Type, PostOffice_SLWB, POSTOFFICE_SLWB, PostOffice_SLWDC, POSTOFFICE_SLWDC, PostOffice_SLWSM, POSTOFFICE_SLWSM, DCDT_PostOffice_SLWSM::SubscribeMsgTypeID(), DCDT_PostOffice_SLWDC::SubscribeMsgTypeID(), and DCDT_PostOffice_SLWBU::SubscribeMsgTypeID(). Referenced by DCDT_Member::SubscribeMsgType(). |
|
Unsubscribe the member Member_ID from all the messages types.
Definition at line 403 of file DCDT_PostOffice.cpp. References PO_Type, PostOffice_SLWB, POSTOFFICE_SLWB, PostOffice_SLWDC, POSTOFFICE_SLWDC, PostOffice_SLWSM, POSTOFFICE_SLWSM, DCDT_PostOffice_SLWSM::UnSubscribeAll(), DCDT_PostOffice_SLWDC::UnSubscribeAll(), and DCDT_PostOffice_SLWBU::UnSubscribeAll(). Referenced by DCDT_Member::UnSubscribeAll(). |
|
Unsubscribe member Member_ID from the messages of type MsgType.
Definition at line 378 of file DCDT_PostOffice.cpp. References PO_Type, PostOffice_SLWB, POSTOFFICE_SLWB, PostOffice_SLWDC, POSTOFFICE_SLWDC, PostOffice_SLWSM, POSTOFFICE_SLWSM, DCDT_PostOffice_SLWSM::UnSubscribeMsgTypeID(), DCDT_PostOffice_SLWDC::UnSubscribeMsgTypeID(), and DCDT_PostOffice_SLWBU::UnSubscribeMsgTypeID(). Referenced by DCDT_Member::UnSubscribeMsgType(). |
|
Chech if the Suscribed mask for the member was changed.
Definition at line 454 of file DCDT_PostOffice.cpp. References PO_Type, PostOffice_SLWB, POSTOFFICE_SLWB, PostOffice_SLWDC, POSTOFFICE_SLWDC, PostOffice_SLWSM, POSTOFFICE_SLWSM, DCDT_PostOffice_SLWSM::UpdateSubs(), DCDT_PostOffice_SLWDC::UpdateSubs(), and DCDT_PostOffice_SLWBU::UpdateSubs(). |
|
Definition at line 97 of file DCDT_PostOffice.h. |
|
Definition at line 96 of file DCDT_PostOffice.h. |
|
Definition at line 123 of file DCDT_PostOffice.h. Referenced by DCDT_PostOffice(). |
|
Definition at line 124 of file DCDT_PostOffice.h. Referenced by AddMember(), AddMsg(), AddSysMember(), CleanupList(), DCDT_PostOffice(), DeleteMemberTableEntry(), ReadLastMsg(), ReadNextMsg(), ReadSubscribedMsgMask(), SubscribeMsgTypeID(), UnSubscribeAll(), UnSubscribeMsgTypeID(), and UpdateSubs(). |
|
Definition at line 126 of file DCDT_PostOffice.h. Referenced by AddMember(), AddMsg(), AddSysMember(), CleanupList(), DCDT_PostOffice(), DeleteMemberTableEntry(), ReadLastMsg(), ReadNextMsg(), ReadSubscribedMsgMask(), SubscribeMsgTypeID(), UnSubscribeAll(), UnSubscribeMsgTypeID(), and UpdateSubs(). |
|
Definition at line 127 of file DCDT_PostOffice.h. Referenced by AddMember(), AddMsg(), AddSysMember(), CleanupList(), DCDT_PostOffice(), DeleteMemberTableEntry(), ReadLastMsg(), ReadNextMsg(), ReadSubscribedMsgMask(), SubscribeMsgTypeID(), UnSubscribeAll(), UnSubscribeMsgTypeID(), and UpdateSubs(). |
|
Definition at line 128 of file DCDT_PostOffice.h. Referenced by AddMember(), AddMsg(), AddSysMember(), CleanupList(), DCDT_PostOffice(), DeleteMemberTableEntry(), ReadLastMsg(), ReadNextMsg(), ReadSubscribedMsgMask(), SubscribeMsgTypeID(), UnSubscribeAll(), UnSubscribeMsgTypeID(), and UpdateSubs(). |