X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Packets%2FPacket.hh;h=39d7bc37f2fdef4a23f591357218d65a3e7d3012;hb=6116cb96ea7bdcb42b7d12165a05fcbe0687226d;hp=fabd6a455cdafc328a121316feea8040f8f4751a;hpb=2d6585ff852e9d282c17003ba1db0b73eb3a8500;p=senf.git diff --git a/Packets/Packet.hh b/Packets/Packet.hh index fabd6a4..39d7bc3 100644 --- a/Packets/Packet.hh +++ b/Packets/Packet.hh @@ -1,3 +1,5 @@ +// $Id$ +// // Copyright (C) 2007 // Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS) // Kompetenzzentrum fuer Satelitenkommunikation (SatCom) @@ -27,8 +29,8 @@ // Custom includes #include -#include "Utils/Exception.hh" -#include "Utils/SafeBool.hh" +#include "../Utils/Exception.hh" +#include "../Utils/safe_bool.hh" #include "PacketInterpreter.hh" //#include "Packet.mpp" @@ -135,7 +137,7 @@ namespace senf { \ref packetparser for a specification of the parser interface */ class Packet - : public SafeBool, + : public safe_bool, public boost::equality_comparable { public: @@ -184,6 +186,8 @@ namespace senf { Packet next() const; ///< Get next packet in chain + /**< \returns in - valid() packet, if no next packet + exists */ template OtherPacket next() const; ///< Get next packet of given type in chain /**< \throws InvalidPacketChainException if no such packet @@ -192,7 +196,8 @@ namespace senf { ///< Get next packet of given type in chain /**< \param[in] nothrow This argument always has the value \c senf::nothrow - \returns in-valid() packet, if no such packet is found */ + \returns in - valid() packet, if no such packet is + found */ template OtherPacket findNext() const; ///< Find next packet of given type in chain /**< findNext() is like next(), it will however return \c @@ -205,11 +210,14 @@ namespace senf { *this if it is of the given type. \param[in] nothrow This argument always has the value \c senf::nothrow - \returns in-valid() packet, if no such packet is found */ + \returns in - valid() packet, if no such packet is + found */ Packet prev() const; ///< Get previous packet in chain + /**< \returns in - valid() packet, if no previous packet + exists */ template OtherPacket prev() const; ///< Get previous packet of given type in chain /**< \throws InvalidPacketChainException if no such packet @@ -218,7 +226,8 @@ namespace senf { ///< Get previous packet of given type in chain /**< \param[in] nothrow This argument always has the value \c senf::nothrow - \returns in-valid() packet, if no such packet is found */ + \returns in - valid() packet, if no such packet is + found */ template OtherPacket findPrev() const; ///< Find previous packet of given type in chain /**< findPrev() is like prev(), it will however return \c @@ -231,7 +240,8 @@ namespace senf { *this if it is of the type \param[in] nothrow This argument always has the value \c senf::nothrow - \returns in-valid() packet, if no such packet is found */ + \returns in - valid() packet, if no such packet is + found */ Packet first() const; @@ -244,7 +254,8 @@ namespace senf { ///< Return first packet of given type in chain /**< \param[in] nothrow This argument always has the value \c senf::nothrow - \returns in-valid() packet, if no such packet is found */ + \returns in - valid() packet, if no such packet is + found */ Packet last() const; ///< Return last packet in chain @@ -256,7 +267,8 @@ namespace senf { ///< Return last packet of given type in chain /**< \param[in] nothrow This argument always has the value \c senf::nothrow - \returns in-valid() packet, if no such packet is found */ + \returns in - valid() packet, if no such packet is + found */ template OtherPacket parseNextAs() const; @@ -321,10 +333,12 @@ namespace senf { bool boolean_test() const; ///< Check, whether the packet is valid() /**< \see valid() */ bool valid() const; ///< Check, whether the packet is valid() - /**< An in-valid() packet does not allow any operation - except checking for validity and assignment. in-valid() - packets serve the same role as 0-pointers. */ - + /**< An in - valid() packet does not allow any operation + except checking for validity and assignment. in - + valid() packets serve the same role as 0-pointers. + + This is an alias for boolean_test() which is called + when using a packet in a boolean context. */ void finalize() const; ///< Update calculated fields /**< This call will update all calculated fields of the @@ -354,7 +368,7 @@ namespace senf { factory_t factory() const; ///< Return factory instance of \c this packet /**< The returned factory instance can be used to create new packets of the given type without knowing the concrete - type of the packet. The valid may be stored away for + type of the packet. The value may be stored away for later use if needed. */ ///@} @@ -372,6 +386,7 @@ namespace senf { template friend class ConcretePacket; + friend class PacketParserBase; }; /** \brief Protocol specific packet handle @@ -581,7 +596,7 @@ namespace senf { ///////////////////////////////hh.e//////////////////////////////////////// #endif -#if !defined(SENF_PACKETS_DECL_ONLY) && !defined(HH_Packet_i_) +#if !defined(HH_Packets__decls_) && !defined(HH_Packet_i_) #define HH_Packet_i_ #include "Packet.cci" #include "Packet.ct" @@ -599,12 +614,3 @@ namespace senf { // comment-column: 40 // End: -// LocalWords: defgroup li html png STL ConcretePacket PacketInterpreterBase -// LocalWords: PacketInterpreter PacketImpl OtherPacket EthernetPacket param -// LocalWords: EthernetPacketType PacketData packetparser nothrow senf prev -// LocalWords: InvalidPacketChainException findNext findPrev parseNextAs tt -// LocalWords: PacketType SomePacketType createAfter createBefore noinit href -// LocalWords: PacketTypeBase TruncatedPacketException http www org Institut -// LocalWords: Fraunhofer fuer offene Kommunikationssysteme FOKUS SatCom Bund -// LocalWords: Kompetenzzentrum Satelitenkommunikation berlios de hh -// LocalWords: addtogroup Structors PacketType dil PacketType's