IBR-DTNSuite 0.6

ibrdtn/ibrdtn/utils/Clock.h

Go to the documentation of this file.
00001 /*
00002  * Clock.h
00003  *
00004  *  Created on: 24.06.2010
00005  *      Author: morgenro
00006  */
00007 
00008 #ifndef CLOCK_H_
00009 #define CLOCK_H_
00010 
00011 #include <sys/types.h>
00012 #include "ibrdtn/data/Bundle.h"
00013 
00014 namespace dtn
00015 {
00016         namespace utils
00017         {
00018                 class Clock
00019                 {
00020                 public:
00021                         Clock();
00022                         virtual ~Clock();
00023 
00024                         static size_t getTime();
00025 
00026                         static bool isExpired(const dtn::data::Bundle &b);
00027 
00032                         static bool isExpired(size_t timestamp, size_t lifetime = 0) __attribute__ ((deprecated));
00033 
00034                         static size_t getExpireTime(const dtn::data::Bundle &b);
00035 
00040                         static size_t getExpireTime(size_t timestamp, size_t lifetime) __attribute__ ((deprecated));
00041 
00048                         static size_t getExpireTime(size_t lifetime);
00049 
00050                         static int timezone;
00051 
00052                         static u_int32_t TIMEVAL_CONVERSION;
00053 
00059                         static float quality;
00060 
00065                         static bool badclock;
00066 
00067                 private:
00068                         static bool __isExpired(size_t timestamp, size_t lifetime = 0);
00069                         static size_t __getExpireTime(size_t timestamp, size_t lifetime);
00070 
00071                 };
00072         }
00073 }
00074 
00075 #endif /* CLOCK_H_ */