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 Packet inline non-template implementation */
28 #define prefix_ inline
29 ///////////////////////////////cci.p///////////////////////////////////////
31 ///////////////////////////////////////////////////////////////////////////
36 prefix_ senf::Packet::Packet()
39 prefix_ senf::Packet senf::Packet::clone()
42 return Packet(ptr()->clone());
45 // Interpreter chain access
47 prefix_ senf::Packet senf::Packet::next()
50 Packet p (next(nothrow));
51 if (!p) throw InvalidPacketChainException();
55 prefix_ senf::Packet senf::Packet::next(NoThrow_t)
58 PacketInterpreterBase::ptr p (ptr()->next());
59 return !p && ptr()->nextPacketRange() ? checkNext() : Packet(p);
62 prefix_ senf::Packet senf::Packet::prev()
65 Packet p (prev(nothrow));
66 if (!p) throw InvalidPacketChainException();
70 prefix_ senf::Packet senf::Packet::prev(NoThrow_t)
73 return Packet(ptr()->prev());
76 prefix_ senf::Packet senf::Packet::first()
79 return Packet(ptr()->first());
82 prefix_ senf::Packet senf::Packet::last()
85 Packet p (ptr()->last());
86 return p.next(nothrow) ? checkLast() : p;
89 prefix_ senf::Packet senf::Packet::parseNextAs(factory_t factory)
92 return Packet(ptr()->parseNextAs(factory));
95 prefix_ senf::Packet senf::Packet::append(Packet packet)
98 return Packet(ptr()->append(packet.ptr()));
103 prefix_ senf::PacketData & senf::Packet::data()
106 return ptr()->data();
109 prefix_ senf::Packet::size_type senf::Packet::size()
112 return data().size();
118 prefix_ bool senf::Packet::operator==(Packet other)
121 return ptr() == other.ptr();
124 prefix_ void senf::Packet::finalize()
127 last(); // Make sure the packet is complete
131 prefix_ void senf::Packet::dump(std::ostream & os)
134 last(); // Make sure the packet is complete
138 prefix_ senf::TypeIdValue senf::Packet::typeId()
141 return ptr()->typeId();
144 prefix_ senf::Packet::factory_t senf::Packet::factory()
147 return ptr()->factory();
150 prefix_ bool senf::Packet::boolean_test()
153 return packet_ && packet_->valid();
158 prefix_ senf::Packet::Packet(PacketInterpreterBase::ptr packet)
162 prefix_ senf::PacketInterpreterBase::ptr senf::Packet::ptr()
165 BOOST_ASSERT(packet_);
169 ///////////////////////////////cci.e///////////////////////////////////////
176 // c-file-style: "senf"
177 // indent-tabs-mode: nil
178 // ispell-local-dictionary: "american"
179 // compile-command: "scons -u test"
180 // comment-column: 40