include/trace-tools/wifi/frame/filter/uniquely_identifiable.hh

00001 /*
00002  * trace-tools - A library and a set of tools to manipulate wireless traces.
00003  * Copyright (C) 2007  Universite Pierre et Marie Curie - Paris 6
00004  *
00005  * This program is free software; you can redistribute it and/or modify
00006  * it under the terms of the GNU General Public License as published by
00007  * the Free Software Foundation; either version 2 of the License, or
00008  * (at your option) any later version.
00009  *
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program; if not, write to the Free Software
00017  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
00018  * MA  02110-1301  USA
00019  *
00020  * Author: Thomas Claveirole <thomas.claveirole@lip6.fr>
00021  */
00022 #ifndef WIFI_FRAME_FILTER_UNIQUELY_IDENTIFIABLE_HH_
00023 # define WIFI_FRAME_FILTER_UNIQUELY_IDENTIFIABLE_HH_
00024 
00025 # include <trace-tools/prism_header.hh>
00026 # include <trace-tools/tool/iterator_base.hh>
00027 # include <trace-tools/tool/iterable.hh>
00028 # include <trace-tools/wifi/addr_mapping.hh>
00029 # include <trace-tools/wifi/mactime_tracker.hh>
00030 
00031 # include "uniquely_identifiable_fwd.hh"
00032 
00033 namespace tool
00034 {
00035 
00040   template <class U, class I, class H, class B1, class B2>
00041   struct types< wifi::frame::filter::internals::ui_iterator<U, I, H, B1, B2> >
00042   {
00043     typedef
00044       wifi::frame::filter::internals::ui_iterator_value_type<U>
00045       value_type;
00046 
00047     typedef
00048       wifi::frame::filter::uniquely_identifiable<U, I, H, B1>
00049       iterable_type;
00050   };
00051 
00056   template <class U, class I, class H, class B>
00057   struct types< wifi::frame::filter::uniquely_identifiable<U, I, H, B> >
00058   {
00059     typedef
00060       wifi::frame::filter::internals::ui_iterator<U, I, H, B, bottom>
00061       iterator;
00062   };
00063 
00064 } // End of namespace tool.
00065 
00066 namespace wifi
00067 {
00068   namespace frame
00069   {
00070 
00077     namespace filter
00078     {
00079 
00081       namespace internals
00082       {
00083 
00085         template <class UniqueId>
00086         struct ui_iterator_value_type: public UniqueId
00087         {
00092           ui_iterator_value_type(const UniqueId&,
00093                                  const tool::microseconds&);
00094 
00096           const tool::microseconds&     microseconds() const;
00097 
00098         private:
00099           tool::microseconds            microseconds_;
00100         };
00101 
00103         template <class U, class I, class H, class B, class Bottom>
00104         struct ui_iterator: tt_inherit(public tool::iterator_base,
00105                                        ui_iterator<U, I, H, B, Bottom>)
00106         {
00108           typedef
00109             tt_get_exact(Bottom, ui_iterator<U, I, H, B, Bottom>) exact_type;
00110           typedef tt_type(iterable_type, exact_type)              iterable_type;
00111 
00113           ui_iterator(iterable_type& uif, bool end);
00114 
00116           void  increment();
00117         };
00118 
00119       } // End of namespace wifi::frame::filter::internals.
00120 
00121 
00123       template <class UniqueId,
00124                 class InputIterator,
00125                 class HeaderType = prism::header,
00126                 class Bottom = tool::bottom>
00127       struct uniquely_identifiable:
00128         tt_inherit(public tool::iterable,
00129                    uniquely_identifiable<UniqueId, InputIterator, HeaderType,
00130                                          Bottom>)
00131       {
00136         uniquely_identifiable(const InputIterator& begin,
00137                               const InputIterator& end,
00138                               addr_mapping&);
00139 
00140         bool            prism_header_noise_means_error;
00141 
00142       private:
00143         InputIterator   next_;
00144         InputIterator   end_;
00145         addr_mapping*   mapping_;
00146         mactime_tracker mactime_;
00147 
00148         friend class internals::ui_iterator<UniqueId,
00149                                             InputIterator,
00150                                             HeaderType,
00151                                             Bottom, tool::bottom>;
00152       };
00153 
00154     } // End of namespace wifi::frame::filter.
00155 
00156   } // End of namespace wifi::frame.
00157 
00158 } // End of namespace wifi.
00159 
00160 # include "uniquely_identifiable.hxx"
00161 
00162 #endif // ! WIFI_FRAME_FILTER_UNIQUELY_IDENTIFIABLE_HH_

Generated on Wed Sep 12 16:02:47 2007 for trace-tools by  doxygen 1.5.3