X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Packets%2FMPEGDVBBundle%2FTLVPacket.hh;h=3954df923041105815cf82daa6f9a8b902772da0;hb=80c17af991e2f4690c7601e4408954322b176fe9;hp=f81eafd99b224ea72a71ca7297975603692c6aeb;hpb=ab243554f940af9f873e1a920d0a6b7886c6f5cf;p=senf.git diff --git a/Packets/MPEGDVBBundle/TLVPacket.hh b/Packets/MPEGDVBBundle/TLVPacket.hh index f81eafd..3954df9 100644 --- a/Packets/MPEGDVBBundle/TLVPacket.hh +++ b/Packets/MPEGDVBBundle/TLVPacket.hh @@ -35,6 +35,12 @@ namespace senf { + /** \brief xxx + + \todo document me + \todo add usefull exceptions strings + + */ struct UnsuportedTLVPacketException : public std::exception { virtual char const * what() const throw() { @@ -42,6 +48,9 @@ namespace senf { } }; + /** \brief xxx + \todo document me + */ class Parse_TLVPacketLength : public detail::packet::ParseIntOps, public PacketParserBase @@ -50,15 +59,15 @@ namespace senf { Parse_TLVPacketLength(data_iterator i, state_type s) : PacketParserBase(i,s) {} typedef boost::uint32_t value_type; - - value_type value() const; + static const size_type init_bytes = 1; + static value_type const min_value = 0; + static value_type const max_value = 4294967295u; + value_type value() const; void value(value_type const & v); Parse_TLVPacketLength const & operator= (value_type other); - - static const size_type init_bytes = 1; - + size_type bytes() const; void init() const; @@ -80,51 +89,55 @@ namespace senf { /** \brief parse TLVPacket Packet - XXX - + \todo document me + \see TLVPacketType */ + template struct Parse_TLVPacket : public PacketParserBase { # include SENF_PARSER() SENF_PARSER_FIELD( type, Parse_UInt32 ); - SENF_PARSER_FIELD( length, Parse_TLVPacketLength ); + SENF_PARSER_FIELD( length, LengthParser ); SENF_PARSER_FINALIZE(Parse_TLVPacket); }; - - /** \brief TLV Packet + + /** \brief generic TLV Packet type + + \todo document me - \par Packet type (typedef): - \ref TLVPacket - - \par Fields: - \ref Parse_TLVPacket - \ingroup protocolbundle_mpegdvb */ + template struct TLVPacketType : public PacketTypeBase { - typedef ConcretePacket packet; - typedef Parse_TLVPacket parser; - +#ifndef DOXYGEN + typedef ConcretePacket > packet; + typedef Parse_TLVPacket parser; +#endif static optional_range nextPacketRange(packet p); - static void init(packet p); static size_type initSize(); + static void finalize(packet p); + static void dump(packet p, std::ostream & os); }; - - typedef TLVPacketType::packet TLVPacket; + + typedef TLVPacketType::packet TLVPacket; + typedef ConcretePacket > TLVFix8Packet; + typedef ConcretePacket > TLVFix16Packet; + typedef ConcretePacket > TLVFix24Packet; + typedef ConcretePacket > TLVFix32Packet; } ///////////////////////////////hh.e//////////////////////////////////////// //#include "TLVPacket.cci" -//#include "TLVPacket.ct" +#include "TLVPacket.ct" //#include "TLVPacket.cti" #endif