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 PacketData inline non-template implementation */
27 #include "../Utils/senfassert.hh"
29 #include "PacketImpl.hh"
30 // #include "PacketParser.hh"
32 #define prefix_ inline
33 ///////////////////////////////cci.p///////////////////////////////////////
35 ///////////////////////////////////////////////////////////////////////////
38 prefix_ senf::detail::PacketImpl & senf::PacketData::impl()
45 prefix_ senf::PacketData::iterator senf::PacketData::begin()
48 SENF_ASSERT(begin_ <= impl().size());
49 return boost::next(impl().begin(),begin_);
52 prefix_ senf::PacketData::iterator senf::PacketData::end()
55 SENF_ASSERT(end_ <= impl().size());
56 return boost::next(impl().begin(),end_);
59 prefix_ senf::PacketData::size_type senf::PacketData::size()
65 prefix_ bool senf::PacketData::empty()
68 return begin_ == end_;
71 prefix_ senf::PacketData::byte senf::PacketData::operator[](size_type n)
74 SENF_ASSERT( n < size() );
75 return *( boost::next(begin(),n) );
78 prefix_ senf::PacketData::byte & senf::PacketData::operator[](size_type n)
80 SENF_ASSERT( n < size() );
81 return *( boost::next(begin(),n) );
84 // Modifying the raw packet data
86 prefix_ void senf::PacketData::insert(iterator pos, byte v)
88 impl().insert(this,pos,v);
91 prefix_ void senf::PacketData::insert(iterator pos, size_type n, byte v)
93 impl().insert(this,pos,n,v);
96 prefix_ void senf::PacketData::erase(iterator pos)
98 impl().erase(this,pos);
101 prefix_ void senf::PacketData::erase(iterator first, iterator last)
103 impl().erase(this,first,last);
106 prefix_ void senf::PacketData::clear()
111 prefix_ bool senf::PacketData::valid()
118 prefix_ senf::PacketData::PacketData(size_type b, size_type e)
119 : impl_(), begin_(b), end_(e)
122 ///////////////////////////////cci.e///////////////////////////////////////
129 // c-file-style: "senf"
130 // indent-tabs-mode: nil
131 // ispell-local-dictionary: "american"
132 // compile-command: "scons -u test"
133 // comment-column: 40