X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Packets%2FPacketParser.hh;h=c6a38e82a4844f23915aa838f9a91e4362572ead;hb=a18d131c38ffe7178ea4736ed3f584125e9903ae;hp=6871d1dcd488846db4a4c3e0c6e8d38e6d2dd301;hpb=3338998867a4d76adb58e93bd12ab8ff2a0cf4df;p=senf.git diff --git a/Packets/PacketParser.hh b/Packets/PacketParser.hh index 6871d1d..c6a38e8 100644 --- a/Packets/PacketParser.hh +++ b/Packets/PacketParser.hh @@ -370,6 +370,7 @@ namespace senf { # else /** \brief Generic parser copying + This operator allows to copy the values of identical parsers. This operation does \e not depend on the parsers detailed implementation, it will just replace the data bytes of the target parser with those from the source parser. This allows to easily copy around complex @@ -404,6 +405,28 @@ namespace senf { Parser operator<<(Parser target, Value const & value); # endif +# ifndef DOXYGEN + template + typename boost::enable_if_c < + boost::is_base_of::value + && ! boost::is_base_of::value, + Parser >::type + operator<<(Parser target, boost::optional const & value); +# else + /** \brief Generic parser value assignment + + This operator allows to assign a value to parsers which implement a value(\a + value) member. This special version allows to assign optional values: IF the + optional value is not set, the assignment will be skipped. + + This operator allows to use a common syntax for assigning values or parsers to a parser. + + \ingroup packetparser + */ + template + Parser operator<<(Parser target, boost::optional const & value); +# endif + /** \defgroup packetparsermacros Helper macros for defining new packet parsers To simplify the definition of simple packet parsers, several macros are provided. Before