00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00031 #ifndef OSC_COUNT_CALLABLE_H
00032 #define OSC_COUNT_CALLABLE_H
00033
00034 #include "OSCCallable.h"
00035 #include "OSCUnpacker.h"
00036
00037 class OSCCountCallable : public OSCCallable
00038 {
00039 private:
00040 string message;
00041 int highest;
00042 int missed;
00043 OSCUnpacker *unpacker;
00044
00045 public:
00046 OSCCountCallable(string message) { this->message = message;
00047 this->highest = 0;
00048 this->missed = 0;
00049 this->unpacker = new OSCUnpacker(); }
00050 virtual ~OSCCountCallable() { }
00051
00052 virtual void call(const std::string& data, Transmit *const reply)
00053 {
00054 string address;
00055 string typetags;
00056 int report;
00057
00058 this->unpacker->setData(data);
00059 this->unpacker->unpackString(&address);
00060 this->unpacker->unpackString(&typetags);
00061 this->unpacker->unpackInt(&report);
00062
00063 if(report != this->highest + 1)
00064 {
00065 cout << this->message << " DISCREPANCY "
00066 << (report - this->highest) << "\t"
00067 << this->missed << endl;
00068
00069 this->missed++;
00070 }
00071
00072 if(report > this->highest) this->highest = report;
00073 }
00074 };
00075
00076 #endif