phy::time< Bottom > Struct Template Reference

Base class for all PHY headers' embedded timing information. More...

#include <wipal/phy/phy.hh>

Inheritance diagram for phy::time< Bottom >:

tool::static_base< Bottom > phy::empty_time< Bottom > phy::uint64_time< Bottom >

List of all members.

Public Types

Static hierarchies related types
typedef HIDDEN exact_type
typedef HIDDEN impl_type

Public Member Functions

impl_type get () const
exact_typeoperator+= (tool::microseconds microseconds)
exact_type operator+ (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 phy::time< Bottom >

Base class for all PHY headers' embedded timing information.

Some PHY headers (e.g. Prism, RadioTap, etc.) embed timing information. For instance Prism headers have mactime and hosttime fields, RadioTap headers have a TSF field. Those fields must be updated during synchronization. This abstract class provides a common interface so WiPal's synchronization functions work whatever the PHY header. When implementing a custom PHY header, subclass this to export timing information to WiPal's internals.

Some PHY headers hold precise timestamps indicating when frames are recorded on the medium (e.g. mactime for Prism headers). WiPal may use this instead of PCAP timestamps to enable a better synchronization. Such timestamps must be of type uint32_t, uint64_t, or struct timeval. When implementing a custom PHY header, define impl_type to the type you want to use and make timestamps available to WiPal with the get() method. (Use WiPal's virtual types mechanism to define impl_type).

If your custom PHY header does not provide such precise timestamps, define impl_type to whatever type you want (e.g. an empty struct). WiPal's synchronization function will then use PCAP timestamps for synchronization.

See also:
phy::empty_time, prism::time, phy::empty_header, prism::header

Member Typedef Documentation

template<class Bottom = tool::bottom>
typedef HIDDEN phy::time< Bottom >::exact_type

Exact type for this template instanciation.

See also:
static_base

Reimplemented from tool::static_base< Bottom >.

Reimplemented in phy::empty_time< Bottom >, phy::uint64_time< Bottom >, and prism::time.


Member Function Documentation

template<class B>
time< B >::impl_type phy::time< B >::get (  )  const [inline]

Retrieve the timestamp to use for synchronization.

This method calls get_impl() which must be defined in subclasses. Do not override it. Define get_impl() in subclasses instead.

See also:
phy::time

References tool::static_base< Bottom >::exact().

template<class B>
time< B >::exact_type & phy::time< B >::operator+= ( tool::microseconds  microseconds  )  [inline]

Add a microsecond count to the current time value.

This methods calls increment() which must be defined in subclasses. Do not override it. Define increment() in subclasses instead.

increment() must return a reference to itself.

template<class B>
time< B >::exact_type phy::time< B >::operator+ ( tool::microseconds  microseconds  )  const [inline]

Add a microsecond count to the current time value.

See also:
operator+=()

References tool::static_base< Bottom >::exact().

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.

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 Fri Mar 28 14:53:32 2008 for wipal by  doxygen 1.5.5