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
00121 unsigned frame_count() const;
00122
00124 unsigned unique_frame_count() const;
00125
00126 private:
00127 const iterable_type* iterable_;
00128 I next_;
00129 mactime_tracker<> mactime_;
00130 unsigned frame_count_;
00131 unsigned uframe_count_;
00132 };
00133
00134 }
00135
00136
00138 template <class UniqueId,
00139 class InputIterator,
00140 class HeaderType,
00141 class Bottom = tool::bottom>
00142 struct uniquely_identifiable:
00143 WP_INHERIT(public tool::iterable,
00144 uniquely_identifiable<UniqueId, InputIterator, HeaderType,
00145 Bottom>)
00146 {
00151 uniquely_identifiable(const InputIterator& begin,
00152 const InputIterator& end,
00153 addr_mapping& map,
00154 tool::endian::endianness phy_end);
00155
00156 private:
00157 InputIterator begin_;
00158 InputIterator end_;
00159 addr_mapping* mapping_;
00160 tool::endian::endianness phy_end_;
00161
00162 friend
00163 class internals::uniquely_identifiable_iterator<UniqueId,
00164 InputIterator,
00165 HeaderType,
00166 Bottom,
00167 tool::bottom>;
00168 };
00169
00180 template <class UniqueId, class HeaderType, class I, class F>
00181 void
00182 for_each_uniquely_identifiable(const I& first,
00183 const I& last,
00184 addr_mapping& mapping,
00185 F& func,
00186 bool filter_prism,
00187 tool::endian::endianness phy_end);
00188
00190 template <class UniqueId, class HeaderType, class I, class F>
00191 void
00192 for_each_uniquely_identifiable(const I& first,
00193 const I& last,
00194 addr_mapping& mapping,
00195 const F& func,
00196 bool filter_prism,
00197 tool::endian::endianness phy_end);
00198
00199 }
00200
00201 }
00202
00203 }
00204
00205 # include "uniquely_identifiable.hxx"
00206
00207 #endif