00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef WIFI_FRAME_FILTER_MICROSECONDS_STAMPER_HH_
00023 # define WIFI_FRAME_FILTER_MICROSECONDS_STAMPER_HH_
00024
00025 # include <wipal/tool/microseconds_stamp.hh>
00026 # include <wipal/tool/valued_iterator.hh>
00027 # include <wipal/wifi/mactime_tracker.hh>
00028 # include <wipal/tool/iterable.hh>
00029
00030 # include "microseconds_stamper_fwd.hh"
00031
00032
00033
00034
00035
00036 namespace tool
00037 {
00038
00039 template <class I, class HT, class B1, class B2>
00040 struct types< wifi::frame::filter::internals::
00041 microseconds_stamper_iterator<I, HT, B1, B2> >
00042 {
00043 typedef wifi::frame::filter::microseconds_stamper<I, HT, B1> iterable_type;
00044 typedef tool::microseconds_stamp<typename I::value_type> value_type;
00045 };
00046
00047 template <class I, class HT, class B>
00048 struct types< wifi::frame::filter::microseconds_stamper<I, HT, B> >
00049 {
00050 typedef wifi::frame::filter::internals::
00051 microseconds_stamper_iterator<I, HT, B, bottom>
00052 iterator;
00053 };
00054
00055 }
00056
00057
00058
00059
00060
00061 namespace wifi
00062 {
00063 namespace frame
00064 {
00065 namespace filter
00066 {
00067
00068 namespace internals
00069 {
00070
00071 template <class InputIterator,
00072 class HeaderType,
00073 class B,
00074 class Bottom = tool::bottom>
00075 struct microseconds_stamper_iterator:
00076 WP_INHERIT(public tool::valued_iterator,
00077 microseconds_stamper_iterator<InputIterator,
00078 HeaderType, B, Bottom>)
00079 {
00081
00082 typedef WP_GET_EXACT(Bottom,
00083 microseconds_stamper_iterator<InputIterator,
00084 HeaderType,
00085 B, Bottom>)
00086 exact_type;
00087 typedef tool::valued_iterator<exact_type> super_type;
00088 typedef WP_TYPE(value_type, exact_type) value_type;
00089 typedef WP_TYPE(iterable_type, exact_type) iterable_type;
00091
00093 microseconds_stamper_iterator(const iterable_type& i, bool end);
00094
00096
00097 bool equal(const microseconds_stamper_iterator& rhs) const;
00098 void increment();
00100
00101 private:
00102 const iterable_type* iterable_;
00103 InputIterator next_;
00104 mactime_tracker<> tracker_;
00105 };
00106
00107 }
00108
00109 template <class InputIterator,
00110 class HeaderType,
00111 class Bottom = tool::bottom>
00112 struct microseconds_stamper:
00113 WP_INHERIT(public tool::iterable, microseconds_stamper<InputIterator,
00114 HeaderType,
00115 Bottom>)
00116 {
00118 microseconds_stamper(const InputIterator& first,
00119 const InputIterator& last,
00120 tool::endian::endianness phy_end,
00121 bool pcap_tstamps);
00122
00123 private:
00124 InputIterator first_;
00125 InputIterator last_;
00126 tool::endian::endianness phy_end_;
00127 bool pcap_tstamps_;
00128
00129 friend
00130 class internals::microseconds_stamper_iterator<InputIterator,
00131 HeaderType,
00132 Bottom, tool::bottom>;
00133 };
00134
00135 }
00136
00137 }
00138
00139 }
00140
00141 # include "microseconds_stamper.hxx"
00142
00143 #endif