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_INTERSECTOR_HXX_
00023 # define WIFI_FRAME_FILTER_INTERSECTOR_HXX_
00024
00025 # include "intersector.hh"
00026
00027 # include <wipal/wifi/frame/filter/non_noisy_prism.hh>
00028 # include <wipal/wifi/frame/filter/uniquely_identifiable.hh>
00029
00030 namespace wifi
00031 {
00032 namespace frame
00033 {
00034 namespace filter
00035 {
00036
00037 template <class U, class HT, template <class, class, class> class Int,
00038 class I1, class I2, class F>
00039 void
00040 provide_intersector(const I1& first1, const I1& last1,
00041 const I2& first2, const I2& last2,
00042 tool::opt::list& options,
00043 F& func)
00044 {
00045 typedef tool::endian::endianness endianness;
00046
00047 const endianness& end = options["endianness"].get<endianness>();
00048 addr_mapping& map = options["mapping"].get<addr_mapping>();
00049
00050 if (options["ignore_noisy_prism"].get<bool>())
00051 {
00052 typedef non_noisy_prism<I1> nnp1;
00053 typedef non_noisy_prism<I2> nnp2;
00054 typedef typename nnp1::const_iterator nnp1_i;
00055 typedef typename nnp2::const_iterator nnp2_i;
00056 typedef uniquely_identifiable<U, nnp1_i, HT> ui1;
00057 typedef uniquely_identifiable<U, nnp2_i, HT> ui2;
00058 typedef typename ui1::const_iterator ui1_i;
00059 typedef typename ui2::const_iterator ui2_i;
00060 typedef Int<ui1_i, ui2_i, tool::bottom> intersector;
00061
00062 nnp1 n1 (first1, last1);
00063 nnp2 n2 (first2, last2);
00064 ui1 u1 (n1.begin(), n1.end(), map, end);
00065 ui2 u2 (n2.begin(), n2.end(), map, end);
00066 intersector i (u1.begin(), u1.end(), u2.begin(), u2.end());
00067
00068 func(i);
00069 }
00070 else
00071 {
00072 typedef uniquely_identifiable<U, I1, HT> ui1;
00073 typedef uniquely_identifiable<U, I2, HT> ui2;
00074 typedef typename ui1::const_iterator ui1_i;
00075 typedef typename ui2::const_iterator ui2_i;
00076 typedef Int<ui1_i, ui2_i, tool::bottom> intersector;
00077
00078 ui1 u1 (first1, last1, map, end);
00079 ui2 u2 (first2, last2, map, end);
00080 intersector i (u1.begin(), u1.end(), u2.begin(), u2.end());
00081
00082 func(i);
00083 }
00084 }
00085
00086 }
00087
00088 }
00089
00090 }
00091
00092 #endif // ! WIFI_FRAME_FILTER_INTERSECTOR_HXX_