#include <DCDT_Member.h>
Inheritance diagram for DCDT_Member:
Public Member Functions | |
DCDT_Member (DCDT_Agora *, DCDT_TIME period) | |
DCDT_Member (DCDT_Agora *) | |
virtual | ~DCDT_Member () |
DCDT_Member * | GetMember (int myID) |
void * | LifeCycle () |
Member main function executed by the member's thread. | |
void | SetID (int ID) |
int | ReadID () |
bool | CheckProfile (unsigned int mask) |
void | Shutdown (int num_sec) |
virtual void | Init () |
virtual void | Close () |
virtual void | DoYourJob (int par=0)=0 |
int | Activate (const char *thdName=NULL) |
Create a new thread that execute this member. | |
void | Run () |
Execute our DoYourJob method periodically, if we are a periodical member or continuously. | |
void | Suspend () |
void | WakeUp () |
void | Exit () |
void | SubscribeMsgType (int type, DCDT_RequestType ReqType=DCDT_ALL_MSG) |
void | UnSubscribeMsgType (int type, DCDT_RequestType ReqType=DCDT_ALL_MSG) |
void | UnSubscribeAll () |
const DCDT_Msg * | ReceiveMsg (bool wait) |
const DCDT_Msg * | ReceiveMsgType (int type, bool wait) |
const DCDT_Msg * | ReceiveLastMsg (int type, bool wait) |
DCDT_Msg * | CreateMsg (int type, int delivery_warranty) |
DCDT_Msg * | CreateMsg (int type) |
void | ShareMsg (DCDT_Msg *) |
DCDT_Msg * | DupMsg (DCDT_Msg *) |
void | Wait (DCDT_TIME sleep_time) |
void | Wait (struct timeval deadline) |
Public Attributes | |
unsigned int | Profile |
Protected Attributes | |
DCDT_PostOffice * | myPostOffice |
char | myIPAddr [INET_ADDRSTRLEN] |
DCDT_Agora * | myAgora |
Agora that the member belongs to. | |
DCDT_Finder * | myFinder |
Our Finder, valid only for system members. | |
int | myID |
Member ID. | |
int | myAgoraID |
Agora ID. | |
bool | EndOfSession |
DCDT_TIME | Period |
Execution period, if == 0 -> cyclic member. | |
DCDT_TIME | ExecTime |
Last cycle duration of DoYourJob method. | |
DCDT_TIME | CycleTime |
Last cycle duration. | |
DCDT_TIME | StartTime |
When this member was activated. | |
timeval | deadline |
int | Status |
int | SubsMsgMask [NUMINT_MSGTYPE] |
Message subscription mask. | |
pthread_t | myThread |
pthread_attr_t | myThreadAttr |
Friends | |
class | DCDT_Agora |
Definition at line 44 of file DCDT_Member.h.
|
Definition at line 45 of file DCDT_Member.cpp. References ExecTime, myAgora, myIPAddr, Period, and DCDT_Agora::ReadIPStrAddr(). |
|
Definition at line 54 of file DCDT_Member.cpp. References ExecTime, myAgora, myIPAddr, Period, and DCDT_Agora::ReadIPStrAddr(). |
|
Definition at line 62 of file DCDT_Member.cpp. |
|
Create a new thread that execute this member. The new thread uses realtime scheduling policy and was detached from the calling process. Definition at line 68 of file DCDT_Member.cpp. References DCDT_TRC_MEMBER, myID, myThread, ThreadStartRoutine(), TRC_ADD_THREAD, TRC_ERROR, and TRC_PRINT. Referenced by DCDT_Agora::ActivateMember(), and DCDT_Agora::ActivateSysMember(). |
|
Definition at line 148 of file DCDT_Member.h. References Profile. |
|
Reimplemented in DCDT_LinkRx, DCDT_LinkTx, and DCDT_MsgManager. Definition at line 67 of file DCDT_Member.h. Referenced by LifeCycle(). |
|
Definition at line 188 of file DCDT_Member.h. References DCDT_TRC_MEMBER, myAgoraID, myID, DCDT_Msg::SetAgoraID(), DCDT_Msg::SetDeliveryWarranty(), DCDT_Msg::SetMemberID(), and TRC_PRINT. |
|
Definition at line 176 of file DCDT_Member.h. References DCDT_TRC_MEMBER, myAgoraID, myID, DCDT_Msg::SetAgoraID(), DCDT_Msg::SetDeliveryWarranty(), DCDT_Msg::SetMemberID(), and TRC_PRINT. Referenced by DCDT_LinkTx::DCDT_LinkTx(). |
|
Implemented in DCDT_Finder, DCDT_InnerLinkManager, DCDT_LinkRx, DCDT_LinkTx, and DCDT_MsgManager. Referenced by Run(). |
|
Definition at line 217 of file DCDT_Member.h. References DCDT_TRC_MEMBER, DCDT_Msg::GetPayload(), DCDT_Msg::ReadPayloadLen(), DCDT_Msg::ReadPriority(), DCDT_Msg::ReadType(), DCDT_Msg::SetPayload(), and TRC_PRINT. |
|
Definition at line 77 of file DCDT_Member.h. |
|
|
|
Reimplemented in DCDT_Finder, DCDT_InnerLinkManager, DCDT_LinkRx, DCDT_LinkTx, and DCDT_MsgManager. Definition at line 66 of file DCDT_Member.h. Referenced by LifeCycle(). |
|
Member main function executed by the member's thread. This functions implements the basic member behavior. 1 - Call Init() 2 - Wait until the Agora' is DCDT_LETSWORK state 3 - Execute the periodical function DoYourJob 4 - Call Close() 5 - Terminate thread Definition at line 110 of file DCDT_Member.cpp. References Close(), Delay(), DCDT_Agora::GetStatus(), GetTime(), Init(), myAgora, myID, Run(), DCDT_Agora::SetActive(), DCDT_Agora::SetInactive(), StartTime, and Status. Referenced by ThreadStartRoutine(). |
|
Definition at line 144 of file DCDT_Member.h. Referenced by DCDT_LinkTx::DoYourJob(), and ThreadStartRoutine(). |
|
Definition at line 172 of file DCDT_Member.h. References myID, myPostOffice, and DCDT_PostOffice::ReadLastMsg(). |
|
Definition at line 164 of file DCDT_Member.h. References myID, myPostOffice, and DCDT_PostOffice::ReadNextMsg(). Referenced by DCDT_LinkTx::DoYourJob(). |
|
Definition at line 168 of file DCDT_Member.h. References myID, myPostOffice, and DCDT_PostOffice::ReadNextMsg(). |
|
Execute our DoYourJob method periodically, if we are a periodical member or continuously.
Definition at line 148 of file DCDT_Member.cpp. References CycleTime, DCDT_TIME, DCDT_TRC_MEMBER, deadline, DoYourJob(), ExecTime, DCDT_Agora::GetStatus(), GetTime(), myAgora, myID, Period, StartTime, Status, TRC_PRINT, tv2DCDT_TIME(), and Wait(). Referenced by LifeCycle(). |
|
Definition at line 140 of file DCDT_Member.h. References myID. |
|
Definition at line 200 of file DCDT_Member.h. References DCDT_PostOffice::AddMsg(), DCDT_Agora::CheckMemberProfile(), DCDT_LOCAL_MSG, DCDT_REMOTE_MSG, DCDT_TRC_MEMBER, MPM_BRIDGE, MPM_LINK, myAgora, myID, myPostOffice, and TRC_PRINT. Referenced by DCDT_LinkRx::DoYourJob(). |
|
Definition at line 238 of file DCDT_Member.h. References DCDT_TERMINATING, Delay(), myAgora, and DCDT_Agora::SetStatus(). |
|
Definition at line 152 of file DCDT_Member.h. References myID, myPostOffice, and DCDT_PostOffice::SubscribeMsgTypeID(). Referenced by DCDT_LinkTx::Subscribe(). |
|
Definition at line 142 of file DCDT_Member.cpp. |
|
Definition at line 160 of file DCDT_Member.h. References myID, myPostOffice, and DCDT_PostOffice::UnSubscribeAll(). Referenced by DCDT_LinkTx::DoYourJob(), and DCDT_LinkRx::DoYourJob(). |
|
Definition at line 156 of file DCDT_Member.h. References myID, myPostOffice, and DCDT_PostOffice::UnSubscribeMsgTypeID(). |
|
Definition at line 235 of file DCDT_Member.cpp. |
|
Definition at line 229 of file DCDT_Member.cpp. References Delay(). Referenced by Run(). |
|
|
|
Definition at line 45 of file DCDT_Member.h. |
|
Last cycle duration.
Definition at line 116 of file DCDT_Member.h. Referenced by Run(). |
|
Definition at line 124 of file DCDT_Member.h. Referenced by Run(). |
|
Definition at line 113 of file DCDT_Member.h. |
|
Last cycle duration of DoYourJob method.
Definition at line 116 of file DCDT_Member.h. Referenced by DCDT_Member(), and Run(). |
|
Agora that the member belongs to.
Definition at line 102 of file DCDT_Member.h. Referenced by DCDT_Member(), LifeCycle(), Run(), ShareMsg(), and Shutdown(). |
|
Agora ID.
Definition at line 111 of file DCDT_Member.h. Referenced by DCDT_Agora::AddMember(), DCDT_Agora::AddSysMember(), and CreateMsg(). |
|
Our Finder, valid only for system members.
Definition at line 105 of file DCDT_Member.h. Referenced by DCDT_Agora::AddMember(), and DCDT_Agora::AddSysMember(). |
|
Member ID.
Definition at line 108 of file DCDT_Member.h. Referenced by Activate(), DCDT_Agora::AddMember(), DCDT_Agora::AddSysMember(), CreateMsg(), LifeCycle(), ReceiveLastMsg(), ReceiveMsg(), ReceiveMsgType(), DCDT_Agora::RemoveMember(), Run(), SetID(), ShareMsg(), SubscribeMsgType(), UnSubscribeAll(), and UnSubscribeMsgType(). |
|
Definition at line 99 of file DCDT_Member.h. Referenced by DCDT_Agora::AddMember(), and DCDT_Member(). |
|
Definition at line 98 of file DCDT_Member.h. Referenced by DCDT_Agora::AddMember(), DCDT_Agora::AddSysMember(), ReceiveLastMsg(), ReceiveMsg(), ReceiveMsgType(), ShareMsg(), SubscribeMsgType(), UnSubscribeAll(), and UnSubscribeMsgType(). |
|
Definition at line 136 of file DCDT_Member.h. Referenced by Activate(), and DCDT_Agora::RemoveMember(). |
|
Definition at line 137 of file DCDT_Member.h. |
|
Execution period, if == 0 -> cyclic member.
Definition at line 116 of file DCDT_Member.h. Referenced by DCDT_Member(), and Run(). |
|
Definition at line 63 of file DCDT_Member.h. Referenced by DCDT_Agora::AddMember(), DCDT_Agora::AddSysMember(), and CheckProfile(). |
|
When this member was activated.
Definition at line 116 of file DCDT_Member.h. Referenced by LifeCycle(), and Run(). |
|
Definition at line 126 of file DCDT_Member.h. Referenced by DCDT_Agora::CheckIfAllMemberReady(), DCDT_Agora::LetsWork(), LifeCycle(), DCDT_Agora::RemoveMember(), and Run(). |
|
Message subscription mask.
Definition at line 133 of file DCDT_Member.h. |