IBR-DTNSuite 0.6

dtn::utils::Clock Class Reference

#include <Clock.h>

List of all members.

Public Member Functions

 Clock ()
virtual ~Clock ()

Static Public Member Functions

static size_t getTime ()
static bool isExpired (const dtn::data::Bundle &b)
static bool isExpired (size_t timestamp, size_t lifetime=0) __attribute__((deprecated))
static size_t getExpireTime (const dtn::data::Bundle &b)
static size_t getExpireTime (size_t timestamp, size_t lifetime) __attribute__((deprecated))
static size_t getExpireTime (size_t lifetime)

Static Public Attributes

static int timezone = 0
static u_int32_t TIMEVAL_CONVERSION = 946684800
static float quality = 0
static bool badclock = false

Detailed Description

Definition at line 18 of file Clock.h.


Constructor & Destructor Documentation

dtn::utils::Clock::Clock ( )

Definition at line 25 of file Clock.cpp.

dtn::utils::Clock::~Clock ( ) [virtual]

Definition at line 29 of file Clock.cpp.


Member Function Documentation

size_t dtn::utils::Clock::getExpireTime ( size_t  timestamp,
size_t  lifetime 
) [static]

This method is deprecated because it does not recognize the AgeBlock as alternative age verification.

Definition at line 48 of file Clock.cpp.

size_t dtn::utils::Clock::getExpireTime ( size_t  lifetime) [static]

Returns the timestamp when this lifetime is going to be expired depending on the current knowledge of time.

Parameters:
lifetimeThe lifetime in seconds.
Returns:
A DTN timestamp.

Definition at line 53 of file Clock.cpp.

References getTime().

Here is the call graph for this function:

bool dtn::utils::Clock::isExpired ( size_t  timestamp,
size_t  lifetime = 0 
) [static]

This method is deprecated because it does not recognize the AgeBlock as alternative age verification.

Definition at line 81 of file Clock.cpp.

bool dtn::utils::Clock::isExpired ( const dtn::data::Bundle b) [static]

Member Data Documentation

bool dtn::utils::Clock::badclock = false [static]

If set to true, all time based functions assume a bad clock and try to use other mechanisms to detect expiration.

Definition at line 65 of file Clock.h.

Referenced by getExpireTime(), dtn::daemon::Configuration::params(), and dtn::data::PrimaryBlock::relabel().

float dtn::utils::Clock::quality = 0 [static]

Defines an estimation about the precision of the local time. If the clock is definitely wrong the value is zero and one when we have a perfect time sync. Everything between one and zero gives an abstract knowledge about the quality of time.

Definition at line 59 of file Clock.h.

Referenced by dtn::data::BundleList::expire().

u_int32_t dtn::utils::Clock::TIMEVAL_CONVERSION = 946684800 [static]

The number of seconds between 1/1/1970 and 1/1/2000.

Definition at line 52 of file Clock.h.

Referenced by getTime().

int dtn::utils::Clock::timezone = 0 [static]

Definition at line 50 of file Clock.h.

Referenced by getTime(), and setGlobalVars().


The documentation for this class was generated from the following files: