X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Packets%2FPacketInterpreter.hh;h=9c6e5bfce10378bf1ce6a295bf48869bdb9aa581;hb=81ffa1c459b96dd44472bcef37e1e373934ee138;hp=d49510f52f5e8de7d509447944a2c23c0324bcf9;hpb=f13c1275e48e97dceb7de7925793a4c69a5aeb61;p=senf.git diff --git a/Packets/PacketInterpreter.hh b/Packets/PacketInterpreter.hh index d49510f..9c6e5bf 100644 --- a/Packets/PacketInterpreter.hh +++ b/Packets/PacketInterpreter.hh @@ -33,7 +33,7 @@ #include "Utils/intrusive_refcount.hh" #include "Utils/pool_alloc_mixin.hh" #include "PacketData.hh" -#include "typeidvalue.hh" +#include "Utils/TypeIdValue.hh" //#include "PacketInterpreter.mpp" ///////////////////////////////hh.p//////////////////////////////////////// @@ -42,7 +42,12 @@ namespace senf { template class PacketInterpreter; - /** \brief + /** \brief Internal: Base packet interpreter class + + \internal + + This is the base class for the persistent interpreter. This class encapsulates all the + functionality accessible via the packet handle, most handle operations are just forwarded. */ class PacketInterpreterBase : protected PacketData, @@ -70,6 +75,14 @@ namespace senf { enum Prepend_t { Prepend }; enum NoInit_t { noinit }; + /** \brief Internal: Abstract packet factory + + \internal + + This abstract class provides an abstract packet factory interface. It allows to call + almost any one of the create / createAfter / createBefore static PacketInterpreter + without static information on the type of packet to create. + */ struct Factory { virtual ~Factory(); @@ -168,6 +181,11 @@ namespace senf { ptr appendClone(detail::PacketImpl * impl, iterator base, iterator new_base); ptr appendClone(detail::PacketImpl * impl, range r); + public: + // Need this for g++ < 4.0. Since PacketInterpreter is not publicly visible, it should not + // be a real problem to make impl() public here + using PacketData::impl; + private: // abstract packet type interface @@ -196,7 +214,13 @@ namespace senf { friend class detail::packet::test::TestDriver; }; - /** \brief Concrete packet interpreter + /** \brief Internal: Concrete packet interpreter + + \internal + + Instantiations of this class build the interpreter chain. This class is accessed by the + packet handles. It provides the packet-type specific functionality in addition to the + interface defined in the PacketInterpreterBase class. \see PacketTypeBase for the \a PacketType interface */ @@ -296,6 +320,12 @@ namespace senf { // factory + /** \brief Internal: Implementation of abstract factory interface + + \internal + + Implements the abstract factory interface for \a PacketType + */ struct FactoryImpl : public Factory { // Create completely new packet @@ -341,12 +371,20 @@ namespace senf { friend class FactoryImpl; }; + /** \brief Invalid packet chain operation + + This exception signals an invalid operation on the chain like trying to find a non-existent + chain member and other similar error conditions. + */ struct InvalidPacketChainException : public std::exception { virtual char const * what() const throw() { return "invalid packet chain"; } }; } ///////////////////////////////hh.e//////////////////////////////////////// +#endif +#if !defined(SENF_PACKETS_DECL_ONLY) && !defined(HH_PacketInterpreter_i_) +#define HH_PacketInterpreter_i_ #include "PacketInterpreter.cci" #include "PacketInterpreter.ct" #include "PacketInterpreter.cti"