Base class for all PHY headers' embedded timing information. More...
#include <wipal/phy/phy.hh>
Public Types | |
typedef HIDDEN | exact_type |
typedef HIDDEN | impl_type |
Public Member Functions | |
impl_type | get () const |
exact_type & | operator+= (tool::microseconds microseconds) |
exact_type | operator+ (tool::microseconds microseconds) const |
Downcast methods | |
const exact_type & | exact () const |
exact_type & | exact () |
const exact_type * | exact_ptr () const |
exact_type * | exact_ptr () |
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.
typedef HIDDEN wpl::phy::time< Bottom >::exact_type |
Exact type for this template instanciation.
Reimplemented from wpl::tool::static_base< Bottom >.
Reimplemented in wpl::phy::empty_time< Bottom >, wpl::phy::uint64_time< Bottom >, and wpl::prism::time.
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.
time< B >::exact_type wpl::phy::time< B >::operator+ | ( | tool::microseconds | microseconds | ) | const [inline] |
Add a microsecond count to the current time value.
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.