00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef PCAP_FRAME_ITERATOR_HXX_
00023 # define PCAP_FRAME_ITERATOR_HXX_
00024
00025 # include <stdexcept>
00026
00027 # include "frame_iterator.hh"
00028
00029 namespace pcapxx
00030 {
00031
00032 namespace internals
00033 {
00034
00035 template <class D, class B>
00036 frame_iterator<D, B>::frame_iterator(descriptor<D>& desc, bool end):
00037 tool::iterator_base<exact_type> (desc, end)
00038 {
00039 }
00040
00041 template <class D, class B>
00042 void
00043 frame_iterator<D, B>::increment()
00044 {
00045 this->v_ = boost::none_t ();
00046 if(this->i_->template loop< fill<D, B> >(this, 1))
00047 throw std::logic_error ("Unknown internal error.");
00048 }
00049
00050 template <class D, class B>
00051 void
00052 fill(void* it, const pkthdr* h, const void* b)
00053 {
00054 static_cast<frame_iterator<D, B>*> (it)->v_ =
00055 typename frame_iterator<D, B>::exact_type::value_type (h, b);
00056 }
00057
00058 }
00059
00060 }
00061
00062 #endif // ! PCAP_FRAME_ITERATOR_HXX_