IBR-DTNSuite  0.8
daemon/src/core/WallClock.h
Go to the documentation of this file.
00001 /*
00002  * Clock.h
00003  *
00004  *  Created on: 17.07.2009
00005  *      Author: morgenro
00006  */
00007 
00008 #ifndef WALLCLOCK_H_
00009 #define WALLCLOCK_H_
00010 
00011 #include <ibrcommon/thread/Thread.h>
00012 #include <ibrcommon/thread/Conditional.h>
00013 #include <ibrcommon/thread/Timer.h>
00014 #include "Component.h"
00015 
00016 namespace dtn
00017 {
00018         namespace core
00019         {
00020                 class WallClock : public ibrcommon::Conditional, public dtn::daemon::IntegratedComponent, public ibrcommon::TimerCallback
00021                 {
00022                 public:
00027                         WallClock(size_t frequency);
00028                         virtual ~WallClock();
00029 
00033                         void sync();
00034 
00039                         virtual size_t timeout(ibrcommon::Timer*);
00040 
00044                         virtual const std::string getName() const;
00045 
00046                 protected:
00047                         virtual void componentUp();
00048                         virtual void componentDown();
00049 
00050                 private:
00051                         size_t _frequency;
00052                         size_t _next;
00053                         ibrcommon::Timer _timer;
00054 
00055                 };
00056         }
00057 }
00058 
00059 #endif /* WALLCLOCK_H_ */