include/trace-tools/pcap/frame_iterator.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 PCAP_FRAME_ITERATOR_HH_
00023 # define PCAP_FRAME_ITERATOR_HH_
00024 
00025 # include <trace-tools/pcap/frame_descriptor.hh>
00026 # include <trace-tools/tool/iterator_base.hh>
00027 
00028 namespace pcapxx
00029 {
00030 
00031   template <class D>
00032   struct descriptor;
00033 
00035   namespace internals
00036   {
00037 
00038     template <class D, class B>
00039     struct frame_iterator;
00040 
00041   } // End of namespace pcapxx::internals.
00042 } // End of namespace pcapxx.
00043 
00044 namespace tool
00045 {
00046 
00048   template <class D, class B>
00049   struct types< pcapxx::internals::frame_iterator<D, B> >
00050   {
00051     typedef pcapxx::frame_descriptor    value_type;
00052     typedef pcapxx::descriptor<D>       iterable_type;
00053   };
00054 
00055 } // End of namespace tool.
00056 
00057 namespace pcapxx
00058 {
00059   namespace internals
00060   {
00061 
00063     template <class Desc, class Bottom = tool::bottom>
00064     struct frame_iterator:
00065       tt_inherit(public tool::iterator_base, frame_iterator<Desc, Bottom>)
00066     {
00067       typedef tt_get_exact(Bottom, frame_iterator<Desc, Bottom>) exact_type;
00068 
00070       frame_iterator(descriptor<Desc>& desc, bool end);
00071 
00073       void              increment();
00074 
00075       template <class D, class B>
00076       friend
00077         void
00078         fill(void*, const pkthdr*, const void*);
00079 
00080     };
00081 
00090     template <class D, class B>
00091     void
00092     fill(void*, const pkthdr*, const void*);
00093 
00094   } // End of namespace pcapxx::internals.
00095 
00096 } // End of namespace pcapxx.
00097 
00098 # include "frame_iterator.hxx"
00099 
00100 #endif // ! PCAP_FRAME_ITERATOR_HH_

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