include/wipal/wifi/frame/filter/reference_blacklist.hh

00001 /*
00002  * WiPal - 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_REFERENCE_BLACKLIST_HH_
00023 # define WIFI_FRAME_FILTER_REFERENCE_BLACKLIST_HH_
00024 
00025 # include <set>
00026 
00027 # include <wipal/tool/filter.hh>
00028 
00029 /*---------------------.
00030 | Forward declarations |
00031 `---------------------*/
00032 
00033 namespace wifi
00034 {
00035   namespace frame
00036   {
00037     namespace filter
00038     {
00039 
00040       namespace internals
00041       {
00042         struct blacklist_predicate;
00043       }
00044 
00045       template <class, class>
00046       struct reference_blacklist;
00047 
00048     }
00049   }
00050 }
00051 
00052 /*--------------.
00053 | Virtual types |
00054 `--------------*/
00055 
00056 namespace tool
00057 {
00058 
00059 #define wp_wff  wifi::frame::filter
00060 #define wp_wffi wp_wff::internals
00061 
00062   template <class I, class B>
00063   struct types< wp_wff::reference_blacklist<I, B> >:
00064     public types< tool::filter<I, wp_wffi::blacklist_predicate,
00065                                wp_get_exact(B,
00066                                             wp_wff::reference_blacklist<I,
00067                                                                         B>)> >
00068   {
00069   };
00070 
00071 #undef wp_wff
00072 #undef wp_wffi
00073 
00074 } // End of namespace tool.
00075 
00076 
00077 /*-------------.
00078 | Declarations |
00079 `-------------*/
00080 
00081 
00082 namespace wifi
00083 {
00084   namespace frame
00085   {
00086     namespace filter
00087     {
00088 
00089       namespace internals
00090       {
00091 
00092         struct blacklist_predicate
00093         {
00094           typedef std::pair<unsigned, unsigned>         blacklist_item;
00095           typedef std::set<blacklist_item>              blacklist;
00096 
00097           blacklist_predicate(const blacklist& l);
00098 
00099           template <class T>
00100           bool
00101           operator () (const T& item) const;
00102 
00103         private:
00104           blacklist     blacklist_;
00105         };
00106 
00107       } // End of namespace wifi::frame::filter::internals.
00108 
00109       template <class InputIterator, class B = tool::bottom>
00110       struct reference_blacklist:
00111         public tool::filter<InputIterator, internals::blacklist_predicate,
00112                             wp_get_exact(B,
00113                                          reference_blacklist<InputIterator, B>)>
00114       {
00115         typedef
00116         tool::filter<InputIterator, internals::blacklist_predicate,
00117                      wp_get_exact(B, reference_blacklist<InputIterator, B>)>
00118                                                                 super_type;
00119         typedef std::set< std::pair<unsigned, unsigned> >       blacklist;
00120 
00121         reference_blacklist(const InputIterator&        first,
00122                             const InputIterator&        last,
00123                             const blacklist&            l);
00124       };
00125 
00126     } // End of namespace wifi::frame::filter.
00127 
00128   } // End of namespace wifi::frame.
00129 
00130 } // End of namespace wifi.
00131 
00132 # include "reference_blacklist.hxx"
00133 
00134 #endif // ! WIFI_FRAME_FILTER_SIMPLE_MERGE_HH_

Generated on Wed Jan 16 16:15:14 2008 for wipal by  doxygen 1.5.4