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

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

#include <wipal/phy/phy.hh>

Inheritance diagram for wpl::phy::time< Bottom >:
wpl::tool::static_base< Bottom > wpl::phy::empty_time< Bottom > wpl::phy::uint64_time< Bottom >

List of all members.

Public 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 wpl::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 wpl::phy::time< Bottom >::exact_type

Exact type for this template instanciation.

See also:
static_base

Reimplemented from wpl::tool::static_base< Bottom >.

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


Member Function Documentation

template<class B >
time< B >::impl_type wpl::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
template<class B >
time< B >::exact_type wpl::phy::time< B >::operator+ ( tool::microseconds  microseconds  )  const [inline]

Add a microsecond count to the current time value.

See also:
operator+=()
template<class B >
time< B >::exact_type & wpl::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.


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

Generated by  doxygen 1.6.2