00001 #ifndef MD_EVENTS
00002 #define MD_EVENTS
00003
00004 class mdAttention: public TimeStampedEvent<>, public PolymorphEvent {
00005
00006 int idx;
00007 public:
00008 mdAttention( int count ) { idx = count; }
00009 virtual void send() const { sendTypedEvent(*this); }
00010
00011 };
00012 class mdClientBirth: public TimeStampedEvent<>, public PolymorphEvent {
00013 public:
00014 bool dgDetermined;
00015 int mdStdDevIdx;
00016 md_device clientType;
00017 std::string signature;
00018 boost::asio::ip::udp::endpoint ip;
00019
00020 mdDatagram dg;
00021 mdReply dgr;
00022
00023 mdClientBirth() {
00024 dgDetermined = false;
00025 mdStdDevIdx = -1;
00026 }
00027 virtual void send() const { sendTypedEvent(*this); }
00028
00029 };
00030 class mdClientDeath: public TimeStampedEvent<>, public PolymorphEvent {
00031
00032 public:
00033 virtual void send() const { sendTypedEvent(*this); }
00034
00035 };
00036 class mdDeviceCommand: public TimeStampedEvent<>, public PolymorphEvent {
00037
00038 public:
00039 virtual void send() const { sendTypedEvent(*this); }
00040
00041 };
00042 class mdIncoming: public TimeStampedEvent<>, public PolymorphEvent {
00043
00044 public:
00045 mdDatagram dg;
00046 boost::asio::ip::udp::endpoint ip;
00047
00048 mdIncoming(mdDGChannel *bus) {dg = *bus->inProcess;}
00049
00050 virtual void send() const { sendTypedEvent(*this); }
00051
00052 };
00053 class mdCDPulse: public TimeStampedEvent<>, public PolymorphEvent {
00054
00055 public:
00056 virtual void send() const { sendTypedEvent(*this); }
00057
00058 };
00059 class mdResponse: public TimeStampedEvent<>, public PolymorphEvent {
00060 public:
00061 int mdStdDevIdx;
00062
00063 md_dispatch_category dCat;
00064 mdDGChannel *bus;
00065 mdReply reply;
00066 boost::asio::ip::udp::endpoint ip;
00067
00068 mdResponse(mdDGChannel *c,udp::endpoint ep) :
00069 bus(c), ip(ep) { mdStdDevIdx = -1; }
00070
00071 virtual void send() const { sendTypedEvent(*this); }
00072
00073 };
00074 class mdTelemetryFrame: public TimeStampedEvent<>, public PolymorphEvent {
00075 public:
00076 int mdStdDevIdx;
00077
00078 mdTelemetryFrame() {mdStdDevIdx = -1;}
00079
00080 virtual void send() const { sendTypedEvent(*this); }
00081 };
00082 #endif