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 (bool force_pcap)
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

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


Constructor & Destructor Documentation

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

Default constructor - initialize the microsecond count to zero.

Parameters:
[in] force_pcap If true, force the use of PCAP timestamps instead of PHY timestamps.


Member Function Documentation

exact_type& tool::static_base< Bottom >::exact (  )  [inherited]

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

const exact_type& tool::static_base< Bottom >::exact (  )  const [inherited]

Safely downcast to the exact type as a const reference.

exact_type* tool::static_base< Bottom >::exact_ptr (  )  [inherited]

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

const exact_type* tool::static_base< Bottom >::exact_ptr (  )  const [inherited]

Safely downcast to the exact type as a const pointer.

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

Retrieve the current microsecond count without wraps.

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]

Update the tracker according to the given frame.

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 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.


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

Generated on Wed Apr 22 22:52:43 2009 for wipal by  doxygen 1.5.8