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

DCDT_Channel.h

Go to the documentation of this file.
00001 /****************************************************************************
00002 dEVICE cOMMUNITIES dEVELOPMENT tOOLKIT 
00003 
00004 DCDT_Channel.h
00005 
00006 COPYRIGHT (C) 2002   Alessandro Mazzini (mazzini@airlab.elet.polimi.it)
00007 
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 DCDT_CHANNEL_H
00026 #define DCDT_CHANNEL_H
00027 
00028 #include <DCDT_Defs.h>
00029 
00030 class DCDT_Msg;
00031 
00034 class DCDT_Channel {
00035  public:
00036   DCDT_Channel(int AgoraID) {
00037     channel_type = 0;
00038     notify.type = HS_NOTIFY;
00039     answer.type = HS_ANSWER;
00040     notify.AgoraID = answer.AgoraID = AgoraID;
00041   }
00042   virtual void Open(int link_status = 0) = 0;
00043   virtual void Reopen(int link_status) = 0;
00048   virtual void Prepare(CommData *local, CommData *remote) = 0;
00049   virtual void ChooseChannel(int channel) = 0;
00050   virtual void WaitConn() = 0;
00051   virtual void StartConn() = 0;
00052   virtual void Send(const DCDT_Msg *msg) = 0;
00053   virtual void SendNotify() = 0;
00054   virtual void SendAnswer(CommData* to, CommData* local) = 0;
00055   virtual DCDT_Msg* Receive() = 0;
00056   virtual void ReceiveHS(HSMsgHeader*& header, CommData*& remote) = 0;
00057   virtual void Dispose() = 0;
00058   virtual void Close() = 0;
00059   virtual void KeepAlive() = 0;
00060 
00062   virtual CommData* GetStartingCD() = 0;
00063   virtual unsigned int ReadStartingProfile() = 0;
00064   virtual CommData* GetCommData() = 0;
00065   virtual void SetTimers() = 0;
00066   virtual void SetLostTimer(int usec) = 0;
00067   virtual void LostTimerOn() = 0;
00068   virtual void LostTimerOff() = 0;
00069   virtual void SetConnTimer(int usec) = 0;
00070   virtual void ConnTimerOn() = 0;
00071   virtual void ConnTimerOff() = 0;
00072   virtual void SetSendTimer(int usec) = 0;
00073   virtual void SendTimerOn() = 0;
00074   virtual void SendTimerOff() = 0;
00075   virtual void UnblockSend() = 0;
00076   virtual void SetReceiveTimer(int usec) = 0;
00077   virtual void ReceiveTimerOn() = 0;
00078   virtual void ReceiveTimerOff() = 0;
00079   virtual void UnblockReceive() = 0;
00080   virtual void Restart(int link_status) = 0;
00081   virtual void Stop() = 0;
00082 
00084   class ChannelErr
00085   {
00086   public:
00087     int errval;
00088     ChannelErr() { errval = 0; };
00089     ChannelErr(int err) { errval = err; };
00090   };
00091 
00093   class TimeOut : public ChannelErr {};
00094 
00095  protected:
00096   HSMsgHeader notify, answer, recvd;
00097   int channel_type;
00098 };
00099 
00100 
00101 #endif

Generated on Sun Jun 19 10:35:49 2005 for dcdt by  doxygen 1.3.9.1