dtn::BundleTimestamp Struct Reference

Simple struct definition for bundle creation timestamps. More...

#include <BundleTimestamp.h>

List of all members.

Public Member Functions

 BundleTimestamp ()
 Default constructor.
 BundleTimestamp (u_int32_t seconds, u_int32_t seqno)
 Constructor by parts.
bool operator== (const BundleTimestamp &other) const
 Operator overload for use in STL data structures.
bool operator< (const BundleTimestamp &other) const
 Operator overload for use in STL data structures.
bool operator> (const BundleTimestamp &other) const
 Operator overload for use in STL data structures.

Static Public Member Functions

static u_int32_t get_current_time ()
 Return the current time in the correct format for the bundle protocol, i.e.
static bool check_local_clock ()
 Check that the local clock setting is valid (i.e.

Public Attributes

u_int32_t seconds_
 Seconds since 1/1/2000.
u_int32_t seqno_
 Sub-second sequence number.

Static Public Attributes

static u_int32_t TIMEVAL_CONVERSION = 946684800
 The number of seconds between 1/1/1970 and 1/1/2000.

Detailed Description

Simple struct definition for bundle creation timestamps.

Although quite similar to a struct timeval, the bundle protocol specification mandates that timestamps should be calculated as seconds since Jan 1, 2000 (not 1970) so we use a different type.

Definition at line 30 of file BundleTimestamp.h.


Constructor & Destructor Documentation

dtn::BundleTimestamp::BundleTimestamp (  )  [inline]

Default constructor.

Definition at line 37 of file BundleTimestamp.h.

dtn::BundleTimestamp::BundleTimestamp ( u_int32_t  seconds,
u_int32_t  seqno 
) [inline]

Constructor by parts.

Definition at line 43 of file BundleTimestamp.h.


Member Function Documentation

bool dtn::BundleTimestamp::check_local_clock (  )  [static]

Check that the local clock setting is valid (i.e.

is at least up to date with the protocol.

Definition at line 44 of file BundleTimestamp.cc.

References dtnsim::gettimeofday(), log_err_p, and TIMEVAL_CONVERSION.

u_int32_t dtn::BundleTimestamp::get_current_time (  )  [static]

Return the current time in the correct format for the bundle protocol, i.e.

seconds since Jan 1, 2000 in UTC.

Definition at line 34 of file BundleTimestamp.cc.

References ASSERT, dtnsim::gettimeofday(), and TIMEVAL_CONVERSION.

Referenced by dtn::CustodySignal::create_custody_signal(), dtn::BundleStatusReport::create_status_report(), and dtn::Bundle::init().

bool dtn::BundleTimestamp::operator< ( const BundleTimestamp other  )  const [inline]

Operator overload for use in STL data structures.

Definition at line 70 of file BundleTimestamp.h.

References seconds_, and seqno_.

bool dtn::BundleTimestamp::operator== ( const BundleTimestamp other  )  const [inline]

Operator overload for use in STL data structures.

Definition at line 61 of file BundleTimestamp.h.

References seconds_, and seqno_.

bool dtn::BundleTimestamp::operator> ( const BundleTimestamp other  )  const [inline]

Operator overload for use in STL data structures.

Definition at line 80 of file BundleTimestamp.h.

References seconds_, and seqno_.


Member Data Documentation

u_int32_t dtn::BundleTimestamp::TIMEVAL_CONVERSION = 946684800 [static]

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

Definition at line 90 of file BundleTimestamp.h.

Referenced by check_local_clock(), get_current_time(), and DTNSim::main().


The documentation for this struct was generated from the following files:
Generated on Sun Nov 21 11:41:01 2010 for DTN Reference Implementation by  doxygen 1.6.3