4 // Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS)
5 // Kompetenzzentrum fuer Satelitenkommunikation (SatCom)
6 // Stefan Bund <stefan.bund@fokus.fraunhofer.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.
23 #ifndef HH_ParseArray_
24 #define HH_ParseArray_ 1
27 #include <utility> // for std::pair
28 #include "ParserBase.hh"
30 //#include "ParseArray.mpp"
31 ///////////////////////////////hh.p////////////////////////////////////////
36 namespace impl { template <class,class> class Parse_Array_iterator; }
38 /* Parse_Array has the external interface of a container class
40 template <unsigned elements, class Parser, class Iterator=nil, class IPacket=nil>
41 struct Parse_Array : public ParserBase<Iterator,IPacket>
43 ///////////////////////////////////////////////////////////////////////////
46 template <class I=nil, class P=nil>
47 struct rebind { typedef Parse_Array<elements,Parser,I,P> parser; };
48 typedef Iterator byte_iterator;
51 explicit Parse_Array(Iterator const & i);
53 static unsigned bytes();
54 bool check(Iterator const & e) const;
57 ///////////////////////////////////////////////////////////////////////////
58 // Container interface
60 typedef typename Parser::template rebind<Iterator>::parser value_type;
61 typedef impl::Parse_Array_iterator<value_type,Iterator> iterator;
62 typedef unsigned size_type;
63 typedef int difference_type;
64 typedef std::pair<iterator,iterator> range_type;
66 static size_type size();
68 iterator begin() const;
70 range_type range() const;
71 iterator value() const;
73 value_type operator[](difference_type i) const;
75 template <class InputIterator>
76 Parse_Array const & operator= (InputIterator const & i);
81 ///////////////////////////////hh.e////////////////////////////////////////
82 //#include "ParseArray.cci"
83 //#include "ParseArray.ct"
84 #include "ParseArray.cti"
91 // c-file-style: "senf"
92 // indent-tabs-mode: nil
93 // ispell-local-dictionary: "american"