00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef WIFI_TRACES_MERGE_HXX_
00023 # define WIFI_TRACES_MERGE_HXX_
00024
00025 # include "merge.hh"
00026
00027 # include <stdexcept>
00028
00029 # include <wipal/pcap/ostream.hh>
00030 # include <wipal/pcap/list.hh>
00031 # include <wipal/filter/merge.hh>
00032
00033 namespace wpl
00034 {
00035
00036 namespace wifi
00037 {
00038
00040 namespace merge_helpers
00041 {
00042
00043 struct dump
00044 {
00045 dump(pcap::ostream& os): os_ (os)
00046 {
00047 }
00048
00049 template <class Merger>
00050 void
00051 operator () (const Merger& m)
00052 {
00053 m.for_each(os_);
00054 }
00055
00056 private:
00057 pcap::ostream& os_;
00058 };
00059
00060 }
00061
00062 template <class UniqueId, class PhyHeader,
00063 template <class, class, class> class Intersector,
00064 template <class, class, class, class> class Merger,
00065 class T1, class T2>
00066 void
00067 merge(T1& t1,
00068 T2& t2,
00069 const std::string& output,
00070 opt::list& options)
00071 {
00072 pcap::ostream os (output, t2);
00073 merge_helpers::dump dump (os);
00074
00075 filter::provide_merge<UniqueId, PhyHeader, Intersector, Merger>
00076 (t1.begin(), t1.end(), t2.begin(), t2.end(), options, dump);
00077 }
00078
00079 }
00080
00081 }
00082
00083 #endif // ! WIFI_TRACES_MERGE_HXX_