4 // Fraunhofer Institute for Open Communication Systems (FOKUS)
5 // Competence Center NETwork research (NET), St. Augustin, GERMANY
6 // Stefan Bund <g0dil@berlios.de>
8 // This program is free software; you can redistribute it and/or modify
9 // it under the terms of the GNU General Public License as published by
10 // the Free Software Foundation; either version 2 of the License, or
11 // (at your option) any later version.
13 // This program is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU General Public License for more details.
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the
20 // Free Software Foundation, Inc.,
21 // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 \brief ArrayParser internal header */
26 #ifndef IH_SENF_Packets_ArrayParser_
27 #define IH_SENF_Packets_ArrayParser_ 1
30 #include <boost/iterator/iterator_facade.hpp>
32 ///////////////////////////////ih.p////////////////////////////////////////
34 /** \brief Internal: Array and Vector iterator
38 This is the iterator type used for both ArrayParser and VectorParser. It is a model of random
41 template <class ElementParser>
42 class senf::detail::ArrayParser_iterator
43 : public boost::iterator_facade< ArrayParser_iterator<ElementParser>,
45 boost::random_access_traversal_tag,
49 ArrayParser_iterator();
50 ArrayParser_iterator(PacketParserBase::data_iterator const & i,
51 PacketParserBase::state_type s);
53 // Needed to elide the []-proxy of iterator_facade
54 ElementParser operator[](int i) const;
56 PacketParserBase::data_iterator raw() const; ///< Return data_iterator
57 /**< Returns the raw data_iterator pointing to the beginning
58 of the current element */
63 friend class boost::iterator_core_access;
65 // iterator_facade interface
67 ElementParser dereference() const;
68 bool equal(ArrayParser_iterator const & other) const;
69 int distance_to(ArrayParser_iterator const & other) const;
74 PacketParserBase::data_iterator i_;
75 PacketParserBase::state_type s_;
78 ///////////////////////////////ih.e////////////////////////////////////////
85 // c-file-style: "senf"
86 // indent-tabs-mode: nil
87 // ispell-local-dictionary: "american"
88 // compile-command: "scons -u test"