00001 #if !defined(DV_EVENTS) && !defined(DV_DRV) 00002 #define DV_EVENTS 00003 00004 class dvHeartbeat: public TimeStampedEvent<>, public PolymorphEvent { 00005 00006 public: 00007 mdDG mdg; 00008 mdReply dgr; 00009 00010 dvHeartbeat() { 00011 00012 mdg.dg.hdr.clientType = thisConfig->thisDeviceType; 00013 mdg.dg.hdr.msgType = MDDG_HEARTBEAT; 00014 00015 }; 00016 00017 ~dvHeartbeat() {}; 00018 virtual void send() const { sendTypedEvent(*this); } 00019 00020 }; 00021 using boost::asio::ip::udp; 00022 class dvIncoming: public TimeStampedEvent<>, public PolymorphEvent { 00023 00024 public: 00025 mdDG mdg; 00026 udp::endpoint ip; 00027 00028 dvIncoming(mdDGChannel &c) {mdg.dg = *(c.inProcess);} 00029 00030 virtual void send() const { sendTypedEvent(*this); } 00031 00032 }; 00033 class dvResponse: public TimeStampedEvent<>, public PolymorphEvent { 00034 public: 00035 bool ackIsNak; 00036 mdDatagram *incoming; 00037 mdDatagram *reply; 00038 udp::endpoint ip; 00039 00040 virtual void send() const { sendTypedEvent(*this); } 00041 00042 }; 00043 class dvQueryMD: public TimeStampedEvent<>, public PolymorphEvent { 00044 00045 public: 00046 mdDG mdg; 00047 dvResponse *dvr; 00048 udp::endpoint ip; 00049 00050 dvQueryMD() {dvr = NULL;} 00051 00052 virtual void send() const { sendTypedEvent(*this); } 00053 00054 }; 00055 class dvShutdown: public TimeStampedEvent<>, public PolymorphEvent { 00056 00057 public: 00058 virtual void send() const { sendTypedEvent(*this); } 00059 }; 00060 class dvTelemetryFrame: public TimeStampedEvent<>, public PolymorphEvent { 00061 00062 public: 00063 md_device dest; 00064 mdDG frame; 00065 00066 virtual void send() const { sendTypedEvent(*this); } 00067 }; 00068 #endif
1.5.6