Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040 #ifndef __JAUS_CORE_TIME_SERVICE__H
00041 #define __JAUS_CORE_TIME_SERVICE__H
00042
00043 #include "jaus/core/sensor.h"
00044 #include "jaus/core/date.h"
00045
00046 namespace JAUS
00047 {
00062 class JAUS_CORE_DLL TimeService : public AccessControl::Child, public Sensor
00063 {
00064 public:
00065 const static std::string Name;
00066
00067 TimeService();
00068
00069 ~TimeService();
00070
00071 virtual bool IsDiscoverable() const { return true; }
00072
00073 virtual bool GenerateEvent(const Events::Subscription& info) const;
00074
00075 virtual bool IsEventSupported(const Events::Type type,
00076 const double requestedPeriodicRate,
00077 const Message* queryMessage,
00078 double& confirmedPeriodicRate,
00079 std::string& errorMessage) const;
00080
00081 virtual void Receive(const Message* message);
00082
00083 virtual Message* CreateMessage(const UShort messageCode) const;
00084
00085 void SetChangeTimeMethod(bool (*changeTime)(const Time& time, const Date& date)) { mpChangeTimeMethod = changeTime; }
00086 protected:
00087 virtual void CheckServiceSynchronization(const unsigned int timeSinceLastCheckMs);
00088 bool (*mpChangeTimeMethod)(const Time& time, const Date& date);
00089 };
00090 }
00091
00092 #endif
00093