00001 /**************************************************************************** 00002 dEVICE cOMMUNITIES dEVELOPMENT tOOLKIT 00003 00004 DCDT_LinkTx.h 00005 00006 COPYRIGHT (C) 2002 Alessandro Mazzini (mazzini@airlab.elet.polimi.it) 00007 Cristian Giussani (cgiussani@fastflow.it) 00008 00009 This library is free software; you can redistribute it and/or 00010 modify it under the terms of the GNU Lesser General Public 00011 License as published by the Free Software Foundation; either 00012 version 2 of the License, or (at your option) any later version. 00013 00014 This library is distributed in the hope that it will be useful, 00015 but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00017 Lesser General Public License for more details. 00018 00019 You should have received a copy of the GNU Lesser General Public 00020 License along with this library; if not, write to the Free Software 00021 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. 00022 00023 ****************************************************************************/ 00024 00025 #ifndef LINKTX_H 00026 #define LINKTX_H 00027 00028 #include <DCDT_Member.h> 00029 #include <DCDT_Channel.h> 00030 00031 class DCDT_LinkRx; 00032 00040 class DCDT_LinkTx : public DCDT_Member { 00041 friend class DCDT_LinkRx; 00042 public: 00043 DCDT_LinkTx(DCDT_Agora *agora, int id, int r_id, DCDT_LinkRx *ptr); 00044 ~DCDT_LinkTx() {}; 00045 00046 void Prepare(DCDT_Channel* ch); 00047 void Init(); 00048 void DoYourJob(int par = 0); 00049 void Close(); 00050 void Subscribe(unsigned int *mask); 00051 void Restart(DCDT_Channel* ch); 00052 void ChangeStatus(int newstat) { status = newstat; }; 00053 00054 private: 00055 int linkID, remoteID; 00056 int creation_status, status, restart_counter, lost_counter; 00057 00059 DCDT_Channel *channel, 00061 *restarting_ch; 00062 unsigned int mymask[NUMINT_MSGTYPE]; 00063 int i; 00064 const DCDT_Msg *msgrcv; 00065 DCDT_Msg *msgsub; 00066 00068 unsigned int subs_mask[NUMINT_MSGTYPE]; 00069 DCDT_LinkRx *LinkRxPtr; 00070 00071 }; 00072 00073 00074 #endif //define