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_SYNCHRONIZER_HH_
00023 # define WIFI_FRAME_FILTER_SYNCHRONIZER_HH_
00024
00025 # include <utility>
00026
00027 # include <gmpxx.h>
00028
00029 # include <wipal/tool/valued_iterator.hh>
00030 # include <wipal/tool/iterable.hh>
00031 # include <wipal/wifi/addr_mapping.hh>
00032
00033 # include "linear_regression_synchronizer_fwd.hh"
00034
00035 namespace tool
00036 {
00037
00038 template <class I, class B1, class B2>
00039 struct types< wifi::frame::filter::internals::lr_sync_iterator<I, B1, B2> >
00040 {
00041 typedef wifi::frame::filter::
00042 synchronized_frame<typename I::value_type::value_type, mpf_class>
00043 value_type;
00044 };
00045
00046 template <class I, class B>
00047 struct types< wifi::frame::filter::linear_regression_synchronizer<I, B> >
00048 {
00049 typedef
00050 wifi::frame::filter::internals::lr_sync_iterator<I, B, bottom>
00051 iterator;
00052 };
00053
00054 }
00055
00056 namespace wifi
00057 {
00058 namespace frame
00059 {
00060 namespace filter
00061 {
00062
00063 template <class OriginalFrameType, class ImplType>
00064 struct synchronized_frame: public OriginalFrameType
00065 {
00066 typedef ImplType impl_type;
00067 typedef typename std::pair<impl_type, impl_type> coefs_type;
00068
00069 synchronized_frame(const OriginalFrameType&, const coefs_type&);
00070
00071 coefs_type coefs;
00072 };
00073
00074 namespace internals
00075 {
00076
00077 template <class I, class B, class Bottom = tool::bottom>
00078 struct lr_sync_iterator: wp_inherit(public tool::valued_iterator,
00079 lr_sync_iterator<I, B, Bottom>)
00080 {
00082
00083 typedef wp_get_exact(Bottom, lr_sync_iterator<I, B, Bottom>)
00084 exact_type;
00085 typedef tool::valued_iterator<exact_type> super_type;
00086 typedef wp_type(value_type, exact_type) value_type;
00088
00089 typedef linear_regression_synchronizer<I, B> iterable_type;
00090
00092 lr_sync_iterator(const iterable_type& iterable, bool end);
00093
00095
00096 bool equal(const exact_type&) const;
00097 void increment();
00099
00100 private:
00101 const iterable_type* iterable_;
00102 I next_;
00103 unsigned next_wpos_;
00104 };
00105
00106 }
00107
00108 template <class InputIterator, class Bottom = tool::bottom>
00109 struct linear_regression_synchronizer:
00110 wp_inherit(public tool::iterable,
00111 linear_regression_synchronizer<InputIterator, Bottom>)
00112 {
00113 linear_regression_synchronizer(const InputIterator& first,
00114 const InputIterator& last);
00115
00116 private:
00117 InputIterator first_;
00118 InputIterator last_;
00119
00120 friend class internals::
00121 lr_sync_iterator<InputIterator, Bottom, tool::bottom>;
00122 };
00123
00134 template <class U, class HT, template <class, class, class> class Int,
00135 class I1, class I2, class F, class BL>
00136 void
00137 provide_lr_synchronizer(const I1& first1, const I1& last1,
00138 const I2& first2, const I2& last2,
00139 addr_mapping& mapping,
00140 F& func,
00141 bool filter_prism,
00142 tool::endian::endianness phy_end,
00143 const BL& blist);
00144
00145 }
00146
00147 }
00148
00149 }
00150
00151 # include "linear_regression_synchronizer.hxx"
00152
00153 #endif