wpl::phy::timetracker< Bottom > Struct Template Reference

Microsecond-grained time tracker. More...

#include <wipal/phy/timetracker.hh>

Inheritance diagram for wpl::phy::timetracker< Bottom >:
wpl::tool::static_base< Bottom >

List of all members.

Public Types

typedef HIDDEN exact_type

Public Member Functions

 timetracker (bool force_pcap)
template<class UIntType >
void tick_uint (UIntType ts)
void tick_tv (const struct timeval &tv)
template<class HeaderType , class S >
void tick (const pkt::packet< S > &frame, tool::end::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 wpl::phy::timetracker< 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 wpl::tool::static_base< Bottom >::exact_type [inherited]

Exact type for this template instanciation.

See also:
static_base

Reimplemented in wpl::filter::internals::fast_intersector_iterator< I1, I2, B, Bottom >, wpl::filter::internals::lr_sync_iterator< I, B, Bottom >, wpl::filter::internals::non_noisy_prism_iterator< I, B, Bottom >, wpl::filter::internals::time_adjuster_iterator< InputIterator1, InputIterator2, HeaderType, B, Bottom >, wpl::filter::internals::timetracker_iterator< InputIterator, HeaderType, B, Bottom >, wpl::filter::internals::uniquely_identifiable_iterator< U, I, H, B, Bottom >, wpl::filter::internals::windowed_merge_iterator< HT, I1, I2, B, Bottom >, wpl::pcap::internals::file_iterator< Stream, Bottom >, wpl::pcap::list< Stream, Bottom >, wpl::pkt::stream< Bottom >, wpl::pcap::istream< Bottom >, wpl::pcap::file< Bottom >, wpl::pcap::indexed_file< Bottom >, wpl::avs::header, wpl::phy::empty_time< Bottom >, wpl::phy::empty_header< Bottom >, wpl::phy::time< Bottom >, wpl::phy::uint64_time< Bottom >, wpl::phy::header< Bottom >, wpl::prism::time, wpl::prism::header, wpl::rtap::header, wpl::tool::internals::filter_iterator< I, P, B, Bottom >, wpl::tool::iterable< Bottom >, wpl::tool::iterator< Bottom >, wpl::tool::list_of_iterables_iterator< T, B, Bottom >, wpl::tool::list_of_iterables< T, Bottom >, wpl::tool::valued_iterator< Bottom >, wpl::tool::window< InputIterator, WSize, Step, Bottom >, wpl::wifi::time_converter< PhyHeaderType, Bottom >, wpl::phy::time< prism::time >, wpl::phy::header< rtap::header >, wpl::phy::header< prism::header >, wpl::phy::header< avs::header >, wpl::tool::iterable< HIDDEN >, wpl::tool::iterator< HIDDEN >, wpl::tool::list_of_iterables< Stream, HIDDEN >, wpl::tool::valued_iterator< HIDDEN >, and wpl::wifi::time_converter< HeaderType >.


Constructor & Destructor Documentation

template<class B >
wpl::phy::timetracker< B >::timetracker ( 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

template<class B >
void wpl::phy::timetracker< B >::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 B >
template<class UIntType >
void wpl::phy::timetracker< B >::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 by  doxygen 1.6.2