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 funPacketRegistry.ons
25 #include "ParseVec.ih"
30 ///////////////////////////////ct.p////////////////////////////////////////
32 ///////////////////////////////////////////////////////////////////////////
33 // senf::Parse_Vector<ElementParser,Sizer>
35 template <class ElementParser, class Sizer>
36 prefix_ void senf::Parse_Vector<ElementParser,Sizer>::init()
39 sizer_.init(i(),state());
41 iterator const e (end());
46 ///////////////////////////////////////////////////////////////////////////
47 // senf::Parse_Vector_Container<ElementParser,Sizer>
49 template <class ElementParser, class Sizer>
50 prefix_ void senf::Parse_Vector_Container<ElementParser,Sizer>::init()
54 iterator const e (end());
61 template <class ElementParser, class Sizer>
62 prefix_ typename senf::Parse_Vector_Container<ElementParser,Sizer>::iterator
63 senf::Parse_Vector_Container<ElementParser,Sizer>::shift(iterator pos, size_type n)
65 size_type ix (std::distance(data().begin(),pos.raw()));
66 data().insert(pos.raw(),n*ElementParser::fixed_bytes,0);
68 return iterator(boost::next(data().begin(),ix),state());
71 template <class ElementParser, class Sizer>
72 template <class Value>
73 prefix_ void senf::Parse_Vector_Container<ElementParser,Sizer>::insert(iterator pos,
77 for (iterator j (shift(pos,n)); n; --n, ++j)
81 template <class ElementParser, class Sizer>
82 template <class ForwardIterator>
83 prefix_ void senf::Parse_Vector_Container<ElementParser,Sizer>::
84 insert(iterator pos, ForwardIterator f, ForwardIterator l,
85 typename boost::disable_if< boost::is_convertible<ForwardIterator,size_type> >::type *)
87 for (iterator j (shift(pos,std::distance(f,l))); f!=l; ++f,++j)
91 template <class ElementParser, class Sizer>
92 prefix_ void senf::Parse_Vector_Container<ElementParser,Sizer>::resize(size_type n)
95 erase(boost::next(begin(),n),end());
97 push_back_space(n-size());
100 template <class ElementParser, class Sizer>
101 template <class Value>
102 prefix_ void senf::Parse_Vector_Container<ElementParser,Sizer>::resize(size_type n, Value value)
105 erase(boost::next(begin(),n),end());
107 push_back(value,n-size());
110 ///////////////////////////////ct.e////////////////////////////////////////
117 // c-file-style: "senf"
118 // indent-tabs-mode: nil
119 // ispell-local-dictionary: "american"
120 // compile-command: "scons -u test"
121 // comment-column: 40