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 addr_mapping& mapping,
00043 F& func,
00044 bool filter_prism,
00045 tool::endian::endianness phy_end)
00046 {
00047 if (filter_prism)
00048 {
00049 typedef non_noisy_prism<I1> nnp1;
00050 typedef non_noisy_prism<I2> nnp2;
00051 typedef typename nnp1::const_iterator nnp1_i;
00052 typedef typename nnp2::const_iterator nnp2_i;
00053 typedef uniquely_identifiable<U, nnp1_i, HT> ui1;
00054 typedef uniquely_identifiable<U, nnp2_i, HT> ui2;
00055 typedef typename ui1::const_iterator ui1_i;
00056 typedef typename ui2::const_iterator ui2_i;
00057 typedef Int<ui1_i, ui2_i, tool::bottom> intersector;
00058
00059 nnp1 n1 (first1, last1);
00060 nnp2 n2 (first2, last2);
00061 ui1 u1 (n1.begin(), n1.end(), mapping, phy_end);
00062 ui2 u2 (n2.begin(), n2.end(), mapping, phy_end);
00063 intersector i (u1.begin(), u1.end(), u2.begin(), u2.end());
00064
00065 func(i);
00066 }
00067 else
00068 {
00069 typedef uniquely_identifiable<U, I1, HT> ui1;
00070 typedef uniquely_identifiable<U, I2, HT> ui2;
00071 typedef typename ui1::const_iterator ui1_i;
00072 typedef typename ui2::const_iterator ui2_i;
00073 typedef Int<ui1_i, ui2_i, tool::bottom> intersector;
00074
00075 ui1 u1 (first1, last1, mapping, phy_end);
00076 ui2 u2 (first2, last2, mapping, phy_end);
00077 intersector i (u1.begin(), u1.end(), u2.begin(), u2.end());
00078
00079 func(i);
00080 }
00081 }
00082
00083 }
00084
00085 }
00086
00087 }
00088
00089 #endif // ! WIFI_FRAME_FILTER_INTERSECTOR_HXX_