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

DCDT_Link.h

Go to the documentation of this file.
00001 /****************************************************************************
00002 dEVICE cOMMUNITIES dEVELOPMENT tOOLKIT 
00003 
00004 DCDT_Link.h
00005 
00006 COPYRIGHT (C) 2002  Paolo Meriggi (meriggi@ing.unibs.it)
00007                     Alessandro Mazzini (mazzini@airlab.elet.polimi.it)
00008 
00009 
00010 This library is free software; you can redistribute it and/or
00011 modify it under the terms of the GNU Lesser General Public
00012 License as published by the Free Software Foundation; either
00013 version 2 of the License, or (at your option) any later version.
00014 
00015 This library is distributed in the hope that it will be useful,
00016 but WITHOUT ANY WARRANTY; without even the implied warranty of
00017 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018 Lesser General Public License for more details.
00019 
00020 You should have received a copy of the GNU Lesser General Public
00021 License along with this library; if not, write to the Free Software
00022 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
00023 
00024 ****************************************************************************/
00025 
00026 #ifndef LINK_H
00027 #define LINK_H
00028 
00029 #include <DCDT_Member.h>
00030 #include <DCDT_Channel.h>
00031 //#include <TCPSocket.h>
00032 
00033 class DCDT_Link : public DCDT_Member {
00034   //friend class DCDT_Finder;
00035  public:
00036   DCDT_Link(DCDT_Agora *agora, int id, int r_id);
00037   ~DCDT_Link() {};
00038 
00039   CommData* Prepare(int stat, CommData *l_cd, CommData *r_cd);
00040   void Init();
00041   void Close();
00042   void DoYourJob(int par = 0);
00043   void Subscribe(unsigned int *mask);
00044   CommData* GetCommData();
00045   CommData* Restart(int restart_status, CommData *l_cd, CommData *r_cd);
00046   void ResetToConnecting(CommData *l_cd, CommData *r_cd);
00047   void ChangeStatus(int newstat);
00048   int ReadStatus() { return status; };
00049   int ReadRemoteID() { return remoteID; };
00050   void SetCDs(CommData *l_cd, CommData *r_cd);
00051 
00052  private:
00053   int linkID, remoteID;
00054   int creation_status, status, restart_counter, lost_counter;
00055   DCDT_Channel *channel;
00056   unsigned int mymask[NUMINT_MSGTYPE];
00057   CommData *localCD, *remoteCD;
00058   DCDT_Msg *msgsub, *msgrcv;
00059   unsigned int *subs_mask_rcv, subs_mask[NUMINT_MSGTYPE];
00060   int i;
00061 
00062 };
00063 
00064 
00065 #endif //define

Generated on Tue Aug 12 17:55:41 2003 for dcdt by doxygen 1.3.2