4 // Fraunhofer Institute for Open Communication Systems (FOKUS)
6 // The contents of this file are subject to the Fraunhofer FOKUS Public License
7 // Version 1.0 (the "License"); you may not use this file except in compliance
8 // with the License. You may obtain a copy of the License at
9 // http://senf.berlios.de/license.html
11 // The Fraunhofer FOKUS Public License Version 1.0 is based on,
12 // but modifies the Mozilla Public License Version 1.1.
13 // See the full license text for the amendments.
15 // Software distributed under the License is distributed on an "AS IS" basis,
16 // WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
17 // for the specific language governing rights and limitations under the License.
19 // The Original Code is Fraunhofer FOKUS code.
21 // The Initial Developer of the Original Code is Fraunhofer-Gesellschaft e.V.
22 // (registered association), Hansastraße 27 c, 80686 Munich, Germany.
23 // All Rights Reserved.
26 // Stefan Bund <g0dil@berlios.de>
29 \brief VectorParser non-inline template implementation */
31 #include "VectorParser.ih"
36 //-/////////////////////////////////////////////////////////////////////////////////////////////////
38 //-/////////////////////////////////////////////////////////////////////////////////////////////////
39 // senf::VectorParser<ElementParser,AuxPolicy>
41 template <class ElementParser, class AuxPolicy>
42 prefix_ void senf::VectorParser<ElementParser,AuxPolicy>::init()
45 AuxPolicy::aux(0, i(), state());
47 iterator const e (end());
52 //-/////////////////////////////////////////////////////////////////////////////////////////////////
53 // senf::VectorParser_Container<ElementParser,AuxPolicy>
55 template <class ElementParser, class AuxPolicy>
56 prefix_ void senf::VectorParser_Container<ElementParser,AuxPolicy>::init()
60 iterator const e (end());
67 template <class ElementParser, class AuxPolicy>
68 prefix_ typename senf::VectorParser_Container<ElementParser,AuxPolicy>::iterator
69 senf::VectorParser_Container<ElementParser,AuxPolicy>::shift(iterator pos, size_type n)
71 size_type ix (std::distance(data().begin(),pos.raw()));
73 data().insert(pos.raw(),n*ElementParser::fixed_bytes,0);
74 return iterator(boost::next(data().begin(),ix),state());
77 template <class ElementParser, class AuxPolicy>
78 template <class Value>
79 prefix_ void senf::VectorParser_Container<ElementParser,AuxPolicy>::insert(iterator pos,
83 for (iterator j (shift(pos,n)); n; --n, ++j)
88 template <class ElementParser, class AuxPolicy>
89 template <class ForwardIterator>
90 prefix_ void senf::VectorParser_Container<ElementParser,AuxPolicy>::
91 insert(iterator pos, ForwardIterator f, ForwardIterator l,
92 typename boost::disable_if< boost::is_convertible<ForwardIterator,size_type> >::type *)
94 for (iterator j (shift(pos,std::distance(f,l))); f!=l; ++f,++j)
98 template <class ElementParser, class AuxPolicy>
99 template <class ForwardIterator>
100 prefix_ void senf::VectorParser_Container<ElementParser,AuxPolicy>::
101 insert(iterator pos, ForwardIterator f, ForwardIterator l)
105 template <class ElementParser, class AuxPolicy>
106 prefix_ void senf::VectorParser_Container<ElementParser,AuxPolicy>::resize(size_type n)
109 erase(boost::next(begin(),n),end());
111 push_back_space(n-size());
114 template <class ElementParser, class AuxPolicy>
115 template <class Value>
116 prefix_ void senf::VectorParser_Container<ElementParser,AuxPolicy>::resize(size_type n,
120 erase(boost::next(begin(),n),end());
122 push_back(value,n-size());
125 //-/////////////////////////////////////////////////////////////////////////////////////////////////
132 // c-file-style: "senf"
133 // indent-tabs-mode: nil
134 // ispell-local-dictionary: "american"
135 // compile-command: "scons -u test"
136 // comment-column: 40