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_AND_SYNCHRONIZE_HXX_
00023 # define WIFI_TRACES_MERGE_AND_SYNCHRONIZE_HXX_
00024
00025 # include "merge_and_synchronize.hh"
00026
00027 # include <wipal/wifi/traces/merge.hh>
00028
00029 namespace wpl
00030 {
00031
00032 namespace wifi
00033 {
00034
00035 template <class UniqueID, class PhyHeader,
00036 template <class, class, class> class Intersector,
00037 template <class, class, class, class> class Merger,
00038 class C>
00039 std::string
00040 merge_and_synchronize(C& traces, opt::list& options)
00041 {
00042 typedef pcap::list<>* list_ptr;
00043 typedef std::set< std::pair<unsigned, unsigned> > blist_type;
00044
00045 if (not options.count("ref_blacklist"))
00046 options.add("ref_blacklist", blist_type ());
00047
00048 std::string out = merge<UniqueID, PhyHeader,
00049 Intersector, Merger>(traces,
00050 options);
00051 pcap::file<> ref (out);
00052
00053 unsigned i = 0;
00054 BOOST_FOREACH(const typename C::value_type& t, traces)
00055 {
00056 std::string outp = ("sync-" +
00057 boost::lexical_cast<std::string> (++i));
00058 pcap::ostream os (outp, t);
00059 merge_helpers::dump dump (os);
00060
00061 filter::provide_time_adjuster<UniqueID,
00062 PhyHeader,
00063 Intersector>(t.begin(), t.end(),
00064 ref.begin(), ref.end(),
00065 options, dump);
00066 }
00067 return out;
00068 }
00069
00070 }
00071
00072 }
00073
00074 #endif // ! WIFI_TRACES_MERGE_AND_SYNCHRONIZE_HXX_