wifi::mactime_tracker< Bottom > Struct Template Reference

Microsecond-grained time tracker. More...

#include <wipal/wifi/mactime_tracker.hh>

Inheritance diagram for wifi::mactime_tracker< Bottom >:

tool::static_base< Bottom >

List of all members.

Public Types

typedef HIDDEN exact_type

Public Member Functions

 mactime_tracker ()
template<class UIntType>
void tick_uint (UIntType ts)
void tick_tv (const struct timeval &tv)
template<class HeaderType, class D>
void tick (const pcapxx::frame_descriptor< D > &frame, tool::endian::endianness phy_end)
tool::microseconds microseconds () const
Downcast methods
const exact_typeexact () const
exact_typeexact ()
const exact_typeexact_ptr () const
exact_typeexact_ptr ()


Detailed Description

template<class Bottom = tool::bottom>
struct wifi::mactime_tracker< Bottom >

Microsecond-grained time tracker.

PHY headers have various fields that holds frames' arrival time on the medium. Some of them are only 32 bits long, thus wrapping every one hour and a half (roughly). This class tracks the evolution of such fields and maintains a microsecond count that does not wrap.

Just call the tick() method for every frames you get in your trace.


Member Typedef Documentation

template<class Bottom>
typedef HIDDEN tool::static_base< Bottom >::exact_type [inherited]


Constructor & Destructor Documentation

template<class Bottom>
wifi::mactime_tracker< Bottom >::mactime_tracker (  )  [inline]

Default constructor - initialize the microsecond count to zero.


Member Function Documentation

template<class Bottom>
template<class UIntType>
void wifi::mactime_tracker< Bottom >::tick_uint ( UIntType  ts  )  [inline]

Update the tracker with the given unsigned integer timestamp.

This method tracks wraparounds and maintains a consistent microsecond count.

template<class Bottom>
void wifi::mactime_tracker< Bottom >::tick_tv ( const struct timeval &  tv  )  [inline]

Update the tracker with the given timeval structure.

This method assumes timeval structures never wrap around. A negative structure (tv_sec < 0) will yield valid but negative microsecond counts).

template<class Bottom>
template<class HT, class D>
void wifi::mactime_tracker< Bottom >::tick ( const pcapxx::frame_descriptor< D > &  frame,
tool::endian::endianness  phy_end 
) [inline]

template<class Bottom>
tool::microseconds wifi::mactime_tracker< Bottom >::microseconds (  )  const [inline]

Retrieve the current microsecond count without wraps.

template<class Bottom>
const static_base< Bottom >::exact_type & tool::static_base< Bottom >::exact (  )  const [inline, inherited]

template<class Bottom>
static_base< Bottom >::exact_type & tool::static_base< Bottom >::exact (  )  [inline, inherited]

Safely downcast to the exact type as a non-const reference.

template<class Bottom>
const static_base< Bottom >::exact_type * tool::static_base< Bottom >::exact_ptr (  )  const [inline, inherited]

Safely downcast to the exact type as a const pointer.

Referenced by pcapxx::frame_descriptor< PCAPDescriptor >::frame_descriptor().

template<class Bottom>
static_base< Bottom >::exact_type * tool::static_base< Bottom >::exact_ptr (  )  [inline, inherited]

Safely downcast to the exact type as a non-const pointer.


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

Generated on Thu Jul 31 16:39:04 2008 for wipal by  doxygen 1.5.6