Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Class Members | File Members

DCDT_LinkTx Class Reference

Member that can transmit on a channel. More...

#include <DCDT_LinkTx.h>

Inheritance diagram for DCDT_LinkTx:

DCDT_Member List of all members.

Public Member Functions

 DCDT_LinkTx (DCDT_Agora *agora, int id, int r_id, DCDT_LinkRx *ptr)
 ~DCDT_LinkTx ()
void Prepare (DCDT_Channel *ch)
void Init ()
void DoYourJob (int par=0)
 FSM machine for the LinkTx member.
void Close ()
void Subscribe (unsigned int *mask)
 Subscribe this member to the new mask messages.
void Restart (DCDT_Channel *ch)
void ChangeStatus (int newstat)

Private Attributes

int linkID
int remoteID
int creation_status
int status
int restart_counter
int lost_counter
DCDT_Channelchannel
 Class that implements the communication functions.
DCDT_Channelrestarting_ch
 Channel to be used after a restart.
unsigned int mymask [NUMINT_MSGTYPE]
int i
const DCDT_Msgmsgrcv
DCDT_Msgmsgsub
unsigned int subs_mask [NUMINT_MSGTYPE]
 Subscriber mask for this Agora, when changes send a message to the remote one.
DCDT_LinkRxLinkRxPtr

Friends

class DCDT_LinkRx

Detailed Description

Member that can transmit on a channel.

This member implements only channel policies for the message transmission, the real transmission was implements in the DCDT_Channel specified by channel.This member has three main goals:

Definition at line 40 of file DCDT_LinkTx.h.


Constructor & Destructor Documentation

DCDT_LinkTx::DCDT_LinkTx DCDT_Agora agora,
int  id,
int  r_id,
DCDT_LinkRx ptr
 

Definition at line 35 of file DCDT_LinkTx.cpp.

References DCDT_Member::CreateMsg(), i, linkID, LinkRxPtr, msgrcv, msgsub, MT_SUBSUPD, mymask, NUMINT_MSGTYPE, remoteID, restart_counter, DCDT_Msg::SetDeliveryWarranty(), DCDT_Msg::SetPayload(), status, subs_mask, and TCP_WARRANTY.

DCDT_LinkTx::~DCDT_LinkTx  )  [inline]
 

Definition at line 44 of file DCDT_LinkTx.h.


Member Function Documentation

void DCDT_LinkTx::ChangeStatus int  newstat  )  [inline]
 

Definition at line 52 of file DCDT_LinkTx.h.

References status.

Referenced by DCDT_LinkRx::DoYourJob().

void DCDT_LinkTx::Close  )  [virtual]
 

Reimplemented from DCDT_Member.

Definition at line 56 of file DCDT_LinkTx.cpp.

Referenced by DoYourJob().

void DCDT_LinkTx::DoYourJob int  par = 0  )  [virtual]
 

FSM machine for the LinkTx member.

Initial state is always L_WORKING.

  • L_WORKING:
    • Check subscription mask, if was changed send an update message
    • Check if there are new messages to be sent
    • Periodically send KeepAlive messages
  • L_RESTARTING: Our LinkRx said to close and reopen the link
  • L_LOST: The communication is lost wait until our LinkRx does something

In any state if an exception occours ( TimeOut, ConnError or ChannelError ) the state is always set to L_LOST

Implements DCDT_Member.

Definition at line 87 of file DCDT_LinkTx.cpp.

References DCDT_LinkRx::ChangeStatus(), channel, Close(), DCDT_TRC_COMM, Delay(), DCDT_Channel::KeepAlive(), L_LOST, L_RESTARTING, L_STOPPING, L_WORKING, LINK_LOST_TIMER, linkID, LinkRxPtr, LINKTX_PERIOD, msgrcv, msgsub, DCDT_Member::ReadID(), DCDT_PostOffice::ReadSubscribedMsgMask(), DCDT_Msg::ReadType(), DCDT_Member::ReceiveMsg(), DCDT_Channel::Send(), status, subs_mask, TRC_PRINT, and DCDT_Member::UnSubscribeAll().

void DCDT_LinkTx::Init  )  [virtual]
 

Reimplemented from DCDT_Member.

Definition at line 52 of file DCDT_LinkTx.cpp.

void DCDT_LinkTx::Prepare DCDT_Channel ch  ) 
 

Definition at line 67 of file DCDT_LinkTx.cpp.

References channel, DCDT_TRC_COMM, status, and TRC_PRINT.

Referenced by DCDT_LinkRx::DoYourJob().

void DCDT_LinkTx::Restart DCDT_Channel ch  ) 
 

Definition at line 159 of file DCDT_LinkTx.cpp.

References restarting_ch, and status.

Referenced by DCDT_LinkRx::DoYourJob().

void DCDT_LinkTx::Subscribe unsigned int *  mask  ) 
 

Subscribe this member to the new mask messages.

Definition at line 144 of file DCDT_LinkTx.cpp.

References DCDT_TRC_COMM, DCDT_Member::SubscribeMsgType(), and TRC_PRINT.

Referenced by DCDT_LinkRx::DoYourJob().


Friends And Related Function Documentation

friend class DCDT_LinkRx [friend]
 

Definition at line 41 of file DCDT_LinkTx.h.


Member Data Documentation

DCDT_Channel* DCDT_LinkTx::channel [private]
 

Class that implements the communication functions.

Definition at line 59 of file DCDT_LinkTx.h.

Referenced by DoYourJob(), and Prepare().

int DCDT_LinkTx::creation_status [private]
 

Definition at line 56 of file DCDT_LinkTx.h.

int DCDT_LinkTx::i [private]
 

Definition at line 63 of file DCDT_LinkTx.h.

Referenced by DCDT_LinkTx().

int DCDT_LinkTx::linkID [private]
 

Definition at line 55 of file DCDT_LinkTx.h.

Referenced by DCDT_LinkTx(), and DoYourJob().

DCDT_LinkRx* DCDT_LinkTx::LinkRxPtr [private]
 

Definition at line 69 of file DCDT_LinkTx.h.

Referenced by DCDT_LinkTx(), and DoYourJob().

int DCDT_LinkTx::lost_counter [private]
 

Definition at line 56 of file DCDT_LinkTx.h.

const DCDT_Msg* DCDT_LinkTx::msgrcv [private]
 

Definition at line 64 of file DCDT_LinkTx.h.

Referenced by DCDT_LinkTx(), and DoYourJob().

DCDT_Msg* DCDT_LinkTx::msgsub [private]
 

Definition at line 65 of file DCDT_LinkTx.h.

Referenced by DCDT_LinkTx(), and DoYourJob().

unsigned int DCDT_LinkTx::mymask[NUMINT_MSGTYPE] [private]
 

Definition at line 62 of file DCDT_LinkTx.h.

Referenced by DCDT_LinkTx().

int DCDT_LinkTx::remoteID [private]
 

Definition at line 55 of file DCDT_LinkTx.h.

Referenced by DCDT_LinkTx().

int DCDT_LinkTx::restart_counter [private]
 

Definition at line 56 of file DCDT_LinkTx.h.

Referenced by DCDT_LinkTx().

DCDT_Channel * DCDT_LinkTx::restarting_ch [private]
 

Channel to be used after a restart.

Definition at line 59 of file DCDT_LinkTx.h.

Referenced by Restart().

int DCDT_LinkTx::status [private]
 

Definition at line 56 of file DCDT_LinkTx.h.

Referenced by ChangeStatus(), DCDT_LinkTx(), DoYourJob(), Prepare(), and Restart().

unsigned int DCDT_LinkTx::subs_mask[NUMINT_MSGTYPE] [private]
 

Subscriber mask for this Agora, when changes send a message to the remote one.

Definition at line 68 of file DCDT_LinkTx.h.

Referenced by DCDT_LinkTx(), and DoYourJob().


The documentation for this class was generated from the following files:
Generated on Sun Jun 19 10:35:51 2005 for dcdt by  doxygen 1.3.9.1