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 // Definition of non-inline template functions
25 #include "ParseListS.ih"
31 ///////////////////////////////ct.p////////////////////////////////////////
33 template <class Parser, class Sentinel, class Iterator, class IPacket>
34 prefix_ unsigned satcom::pkf::Parse_ListS<Parser,Sentinel,Iterator,IPacket>::bytes()
42 // The sentinel is not part of the range
43 // but it's part of the list !!
47 template <class Parser, class Sentinel, class Iterator, class IPacket>
49 satcom::pkf::Parse_ListS<Parser,Sentinel,Iterator,IPacket>::check(Iterator const & e)
52 byte_iterator i (this->i());
55 if (!v.check(e)) return false;
56 if (sentinel::check(v)) return true;
57 size_type s (v.bytes());
58 if (s==0) return false;
63 template <class Parser, class Sentinel, class Iterator, class IPacket>
64 prefix_ void satcom::pkf::Parse_ListS<Parser,Sentinel,Iterator,IPacket>::init()
71 // The sentinel is not part of the range
72 // but it's part of the list !!
76 ///////////////////////////////////////////////////////////////////////////
77 // satcom::pkf::Parse_ListS_wrapper<Parser,Sentinel,Container>
79 template <class Parser, class Sentinel, class Container>
80 template <class Value>
82 satcom::pkf::Parse_ListS_wrapper<Parser,Sentinel,Container>::insert(iterator pos,
85 // FIXME: What, if pos == end() / default constructed iterator ?
86 size_type ix (pos.raw()-container_.begin());
87 container_.insert(pos.raw(),t.bytes(),0);
88 Parser(container_.begin()+ix).value(t);
91 template <class Parser, class Sentinel, class Container>
92 template <class Value>
94 satcom::pkf::Parse_ListS_wrapper<Parser,Sentinel,Container>::insert(iterator pos, size_type n,
97 size_type ix (pos.raw()-container_.begin());
98 container_.insert(pos.raw(),n*t.bytes(),0);
99 typename Container::iterator i (container_.begin()+ix);
104 template <class Parser, class Sentinel, class Container>
105 template <class InputIterator>
107 satcom::pkf::Parse_ListS_wrapper<Parser,Sentinel,Container>::insert(iterator pos,
111 for (;f!=l;++f,++pos) insert(pos,*f);
114 ///////////////////////////////ct.e////////////////////////////////////////
120 // c-file-style: "satcom"