X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Packets%2FPacketParser.hh;h=ca57409154697af70a8cd872c217e7d958ac4545;hb=688f3266c15bd532194fe81e704c0a2cf320375a;hp=b3e29966cb74908bb8f260cb0a02ed4240f633dc;hpb=54eed72c506b09ef5b4be0b62fecedfbc0e3f261;p=senf.git diff --git a/Packets/PacketParser.hh b/Packets/PacketParser.hh index b3e2996..ca57409 100644 --- a/Packets/PacketParser.hh +++ b/Packets/PacketParser.hh @@ -107,6 +107,8 @@ pointers, it should hold a copy of the value (it's Ok for \c value() to return such a reference as long as assigning it to a \c value_type variable will copy the value). + \see parseint + \subsection parserimpl_collection Collection parsers A collection parser \a SomeParser should model STL containers. The parsers themselves will @@ -120,6 +122,8 @@ parser. Instead, you can rely on senf::Parse_Vector or senf::Parse_List and implement new policies. + \see parsecollection + \subsection parserimpl_composite Composite parsers If possible, composite parsers should be implemented using the \ref packetparsermacros. In @@ -151,7 +155,7 @@ #include #include #include -#include "../Utils/SafeBool.hh" +#include "../Utils/safe_bool.hh" #include "PacketTypes.hh" #include "PacketData.hh" #include "ParseHelpers.hh" @@ -177,10 +181,8 @@ namespace senf { Both kinds of parser need to derive from PacketParserBase and implement several required members. Which members to implement depends on the parsers flavor. There are two ways how to do this. - \li If the parser just consists of a simple sequence of consecutive fields (sub-parsers), - the \ref SENF_PACKET_PARSER_DEFINE_FIELDS and \ref - SENF_PACKET_PARSER_DEFINE_FIXED_FIELDS macros provide a simple and convenient way to - define the packet + \li If the parser just consists of sequence of consecutive fields (sub-parsers), the \ref + packetparsermacros provide a simple yet flexible way to define a packet parser. \li In more complex cases, you need to implement the necessary members manually. This documentation is about the manual implementation. You should nevertheless read through @@ -241,6 +243,7 @@ namespace senf { typedef detail::packet::difference_type difference_type; ///< Signed integral type typedef detail::packet::byte byte; ///< Unsigned 8bit value, the raw value type typedef PacketData * state_type; ///< Type of the 'state' parameter + typedef PacketParserBase parser_base_type; ///< Base type of the next parser /////////////////////////////////////////////////////////////////////////// ///\name Structors and default members @@ -463,7 +466,7 @@ namespace senf { */ template class SafePacketParser - : public SafeBool< SafePacketParser > + : public safe_bool< SafePacketParser > { public: ///////////////////////////////////////////////////////////////////////////