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_UNIQUELY_IDENTIFIABLE_HH_
00023 # define WIFI_FRAME_FILTER_UNIQUELY_IDENTIFIABLE_HH_
00024
00025 # include <wipal/tool/endianness.hh>
00026 # include <wipal/tool/microseconds_stamp.hh>
00027 # include <wipal/tool/valued_iterator.hh>
00028 # include <wipal/wifi/mactime_tracker.hh>
00029 # include <wipal/tool/iterable.hh>
00030 # include <wipal/wifi/addr_mapping.hh>
00031
00032 # include "uniquely_identifiable_fwd.hh"
00033
00034
00035
00036
00037
00038 namespace tool
00039 {
00040
00047 template <class U, class I, class H, class B1, class B2>
00048 struct types< wifi::frame::filter::internals::
00049 uniquely_identifiable_iterator<U, I, H, B1, B2> >
00050 {
00051 typedef
00052 wifi::frame::filter::uniquely_identifiable<U, I, H, B1> iterable_type;
00053 typedef tool::microseconds_stamp<U> value_type;
00054 };
00055
00061 template <class U, class I, class H, class B>
00062 struct types< wifi::frame::filter::uniquely_identifiable<U, I, H, B> >
00063 {
00064 typedef wifi::frame::filter::internals::
00065 uniquely_identifiable_iterator<U, I, H, B, bottom>
00066 iterator;
00067 };
00068
00069 }
00070
00071
00072
00073
00074
00075 namespace wifi
00076 {
00077 namespace frame
00078 {
00079
00086 namespace filter
00087 {
00088
00090 namespace internals
00091 {
00092
00094 template <class U, class I, class H, class B, class Bottom>
00095 struct uniquely_identifiable_iterator:
00096 WP_INHERIT(public tool::valued_iterator,
00097 uniquely_identifiable_iterator<U, I, H, B, Bottom>)
00098 {
00099
00101
00102 typedef WP_GET_EXACT(Bottom,
00103 uniquely_identifiable_iterator<U, I, H,
00104 B, Bottom>)
00105 exact_type;
00106 typedef tool::valued_iterator<exact_type> super_type;
00107 typedef WP_TYPE(value_type, exact_type) value_type;
00108 typedef WP_TYPE(iterable_type, exact_type) iterable_type;
00110
00112 uniquely_identifiable_iterator(const iterable_type& uif, bool end);
00113
00115
00116 bool equal(const uniquely_identifiable_iterator& rhs) const;
00117 void increment();
00119
00120 private:
00121 const iterable_type* iterable_;
00122 I next_;
00123 mactime_tracker<> mactime_;
00124 };
00125
00126 }
00127
00128
00130 template <class UniqueId,
00131 class InputIterator,
00132 class HeaderType,
00133 class Bottom = tool::bottom>
00134 struct uniquely_identifiable:
00135 WP_INHERIT(public tool::iterable,
00136 uniquely_identifiable<UniqueId, InputIterator, HeaderType,
00137 Bottom>)
00138 {
00143 uniquely_identifiable(const InputIterator& begin,
00144 const InputIterator& end,
00145 addr_mapping& map,
00146 tool::endian::endianness phy_end);
00147
00148 private:
00149 InputIterator begin_;
00150 InputIterator end_;
00151 addr_mapping* mapping_;
00152 tool::endian::endianness phy_end_;
00153
00154 friend
00155 class internals::uniquely_identifiable_iterator<UniqueId,
00156 InputIterator,
00157 HeaderType,
00158 Bottom,
00159 tool::bottom>;
00160 };
00161
00172 template <class UniqueId, class HeaderType, class I, class F>
00173 void
00174 for_each_uniquely_identifiable(const I& first,
00175 const I& last,
00176 addr_mapping& mapping,
00177 F& func,
00178 bool filter_prism,
00179 tool::endian::endianness phy_end);
00180
00182 template <class UniqueId, class HeaderType, class I, class F>
00183 void
00184 for_each_uniquely_identifiable(const I& first,
00185 const I& last,
00186 addr_mapping& mapping,
00187 const F& func,
00188 bool filter_prism,
00189 tool::endian::endianness phy_end);
00190
00191 }
00192
00193 }
00194
00195 }
00196
00197 # include "uniquely_identifiable.hxx"
00198
00199 #endif