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 VectorParser non-inline template implementation */
26 #include "VectorParser.ih"
31 ///////////////////////////////ct.p////////////////////////////////////////
33 ///////////////////////////////////////////////////////////////////////////
34 // senf::VectorParser<ElementParser,AuxPolicy>
36 template <class ElementParser, class AuxPolicy>
37 prefix_ void senf::VectorParser<ElementParser,AuxPolicy>::init()
42 iterator const e (end());
47 ///////////////////////////////////////////////////////////////////////////
48 // senf::VectorParser_Container<ElementParser,AuxPolicy>
50 template <class ElementParser, class AuxPolicy>
51 prefix_ void senf::VectorParser_Container<ElementParser,AuxPolicy>::init()
55 iterator const e (end());
62 template <class ElementParser, class AuxPolicy>
63 prefix_ typename senf::VectorParser_Container<ElementParser,AuxPolicy>::iterator
64 senf::VectorParser_Container<ElementParser,AuxPolicy>::shift(iterator pos, size_type n)
66 size_type ix (std::distance(data().begin(),pos.raw()));
68 data().insert(pos.raw(),n*ElementParser::fixed_bytes,0);
69 return iterator(boost::next(data().begin(),ix),state());
72 template <class ElementParser, class AuxPolicy>
73 template <class Value>
74 prefix_ void senf::VectorParser_Container<ElementParser,AuxPolicy>::insert(iterator pos,
78 for (iterator j (shift(pos,n)); n; --n, ++j)
83 template <class ElementParser, class AuxPolicy>
84 template <class ForwardIterator>
85 prefix_ void senf::VectorParser_Container<ElementParser,AuxPolicy>::
86 insert(iterator pos, ForwardIterator f, ForwardIterator l,
87 typename boost::disable_if< boost::is_convertible<ForwardIterator,size_type> >::type *)
89 for (iterator j (shift(pos,std::distance(f,l))); f!=l; ++f,++j)
93 template <class ElementParser, class AuxPolicy>
94 template <class ForwardIterator>
95 prefix_ void senf::VectorParser_Container<ElementParser,AuxPolicy>::
96 insert(iterator pos, ForwardIterator f, ForwardIterator l)
100 template <class ElementParser, class AuxPolicy>
101 prefix_ void senf::VectorParser_Container<ElementParser,AuxPolicy>::resize(size_type n)
104 erase(boost::next(begin(),n),end());
106 push_back_space(n-size());
109 template <class ElementParser, class AuxPolicy>
110 template <class Value>
111 prefix_ void senf::VectorParser_Container<ElementParser,AuxPolicy>::resize(size_type n,
115 erase(boost::next(begin(),n),end());
117 push_back(value,n-size());
120 ///////////////////////////////ct.e////////////////////////////////////////
127 // c-file-style: "senf"
128 // indent-tabs-mode: nil
129 // ispell-local-dictionary: "american"
130 // compile-command: "scons -u test"
131 // comment-column: 40