X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Packets%2FPacketParser.hh;h=1e389da790b1499f51a0e40f9fe06589a8b6a3dc;hb=8f1a688cea76f2e76bfa0193dff9c1538929147e;hp=c85ff2ff99b9398309b91e12d1f579a8010b8121;hpb=10985d71f77b627bc4da543d7114feb7c4529329;p=senf.git diff --git a/Packets/PacketParser.hh b/Packets/PacketParser.hh index c85ff2f..1e389da 100644 --- a/Packets/PacketParser.hh +++ b/Packets/PacketParser.hh @@ -328,11 +328,22 @@ namespace senf { beginning at \a i. Automatically passes \a state() to the new parser. */ + template Parser parse(Arg const & arg, data_iterator i) const; + ///< Create sub-parser + /**< This is like parse(data_iterator), however it passes + the extra argument \a arg to the \a Parser + constructor. */ + template Parser parse(size_type n) const; ///< Create sub-parser /**< Creates a new instance of \a Parser to parse data * beginning at i() + \a n. Automatically passes \a state() to the new parser. */ + template Parser parse(Arg const & arg, size_type n) const; + ///< Create sub-parser + /**< This is like parse(size_type), however it passes the + extra argument \a arg to the \a Parser constructor. */ + void defaultInit() const; ///< Default implementation /**< This is just an empty default implementation. Re-implement this member in your own @@ -370,6 +381,7 @@ namespace senf { PacketParserBase::size_type bytes(Parser p); namespace detail { template class ParserInitBytes; } + namespace detail { template class ParserIsFixed; } /** \brief Return number of bytes to allocate to new object of given type @@ -390,6 +402,10 @@ namespace senf { struct init_bytes : public detail::ParserInitBytes {}; + template + struct is_fixed : public detail::ParserIsFixed + {}; + # ifndef DOXYGEN template typename boost::enable_if<