-// Copyright (C) 2007
-// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS)
-// Kompetenzzentrum fuer Satelitenkommunikation (SatCom)
+// $Id$
+//
+// Copyright (C) 2007
+// Fraunhofer Institute for Open Communication Systems (FOKUS)
+// Competence Center NETwork research (NET), St. Augustin, GERMANY
// Stefan Bund <g0dil@berlios.de>
//
// This program is free software; you can redistribute it and/or modify
\brief Packet inline non-template implementation */
// Custom includes
+#include "../Utils/senfassert.hh"
#define prefix_ inline
///////////////////////////////cci.p///////////////////////////////////////
prefix_ senf::Packet senf::Packet::next()
const
{
+ Packet p (next(nothrow));
+ if (!p) throw InvalidPacketChainException();
+ return p;
+}
+
+prefix_ senf::Packet senf::Packet::next(NoThrow_t)
+ const
+{
PacketInterpreterBase::ptr p (ptr()->next());
return !p && ptr()->nextPacketRange() ? checkNext() : Packet(p);
}
prefix_ senf::Packet senf::Packet::prev()
const
{
+ Packet p (prev(nothrow));
+ if (!p) throw InvalidPacketChainException();
+ return p;
+}
+
+prefix_ senf::Packet senf::Packet::prev(NoThrow_t)
+ const
+{
return Packet(ptr()->prev());
}
const
{
Packet p (ptr()->last());
- return p.next() ? checkLast() : p;
+ return p.next(nothrow) ? checkLast() : p;
}
prefix_ senf::Packet senf::Packet::parseNextAs(factory_t factory)
prefix_ void senf::Packet::finalize()
const
{
+ last(); // Make sure the packet is complete
ptr()->finalize();
}
prefix_ senf::PacketInterpreterBase::ptr senf::Packet::ptr()
const
{
- BOOST_ASSERT(packet_);
+ SENF_ASSERT(packet_);
return packet_;
}
// indent-tabs-mode: nil
// ispell-local-dictionary: "american"
// compile-command: "scons -u test"
+// comment-column: 40
// End: