00001 #ifndef MEASUREMENTWORKER_H_ 00002 #define MEASUREMENTWORKER_H_ 00003 00004 #include "emma/MeasurementJob.h" 00005 #include "emma/GPSProvider.h" 00006 #include "core/AbstractWorker.h" 00007 #include "core/EventReceiver.h" 00008 #include "utils/Service.h" 00009 #include <string> 00010 00011 using namespace std; 00012 using namespace dtn::core; 00013 using namespace dtn::utils; 00014 00015 namespace emma 00016 { 00017 struct MeasurementWorkerConfig 00018 { 00019 unsigned int interval; 00020 string destination; 00021 unsigned int lifetime; 00022 bool custody; 00023 vector<MeasurementJob> jobs; 00024 }; 00025 00026 class MeasurementWorker : public AbstractWorker, public Service, public EventReceiver 00027 { 00028 public: 00029 MeasurementWorker(MeasurementWorkerConfig config); 00030 ~MeasurementWorker(); 00031 void tick(); 00032 unsigned char* needMore(unsigned char* data, unsigned int used, unsigned int needed); 00033 00037 void raiseEvent(const Event *evt); 00038 00039 TransmitReport callbackBundleReceived(const Bundle &b); 00040 00041 protected: 00042 virtual void initialize(); 00043 virtual void terminate(); 00044 00045 private: 00046 unsigned int m_dtntime; 00047 unsigned int m_datasize; 00048 string m_source; 00049 00050 MeasurementWorkerConfig m_config; 00051 pair<double,double> m_position; 00052 }; 00053 } 00054 00055 #endif /*MEASUREMENTWORKER_H_*/
1.5.6