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
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
#include <boost/utility/enable_if.hpp>
#include <boost/type_traits.hpp>
#include <boost/optional.hpp>
-#include "../Utils/SafeBool.hh"
+#include "../Utils/safe_bool.hh"
#include "PacketTypes.hh"
#include "PacketData.hh"
#include "ParseHelpers.hh"
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
*/
template <class Parser>
class SafePacketParser
- : public SafeBool< SafePacketParser<Parser> >
+ : public safe_bool< SafePacketParser<Parser> >
{
public:
///////////////////////////////////////////////////////////////////////////