X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Packets%2FMPEGDVBBundle%2FTLVPacket.hh;h=492507519b5de73664853abd51aa4414f0c0e256;hb=a4ebeef29f8eb69dc2dad10668d762540002b924;hp=d33c48c98d4572f7ffc8bf1a94875b812252765b;hpb=a1001797645cc68c869ef296f5e9ba13aa8e80c4;p=senf.git diff --git a/Packets/MPEGDVBBundle/TLVPacket.hh b/Packets/MPEGDVBBundle/TLVPacket.hh index d33c48c..4925075 100644 --- a/Packets/MPEGDVBBundle/TLVPacket.hh +++ b/Packets/MPEGDVBBundle/TLVPacket.hh @@ -1,9 +1,9 @@ // $Id$ // // Copyright (C) 2007 -// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS) -// Kompetenzzentrum fuer Satelitenkommunikation (SatCom) -// Thorsten Horstmann +// Fraunhofer Institute for Open Communication Systems (FOKUS) +// Competence Center NETwork research (NET), St. Augustin, GERMANY +// Thorsten Horstmann // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -41,22 +41,19 @@ namespace senf { \todo add usefull exceptions strings */ - struct UnsuportedTLVPacketException : public std::exception - { - virtual char const * what() const throw() { - return "length of length can be max. 4 bytes. Sorry."; - } - }; + struct UnsuportedTLVPacketException : public senf::Exception + { UnsuportedTLVPacketException() + : senf::Exception("length of length can be max. 4 bytes. Sorry."){} }; /** \brief xxx \todo document me */ - class TLVPacketLengthParser - : public detail::packet::IntParserOps, + class DynamicTLVLengthParser + : public detail::packet::IntParserOps, public PacketParserBase { public: - TLVPacketLengthParser(data_iterator i, state_type s) : PacketParserBase(i,s) {} + DynamicTLVLengthParser(data_iterator i, state_type s) : PacketParserBase(i,s) {} typedef boost::uint32_t value_type; static const size_type init_bytes = 1; @@ -66,10 +63,8 @@ namespace senf { value_type value() const; void value(value_type const & v); - TLVPacketLengthParser const & operator= (value_type other); - + DynamicTLVLengthParser const & operator= (value_type other); size_type bytes() const; - void init() const; private: @@ -93,12 +88,12 @@ namespace senf { \see TLVPacketType */ - template + template struct TLVPacketParser : public PacketParserBase { # include SENF_PARSER() - SENF_PARSER_FIELD( type, UInt32Parser ); + SENF_PARSER_FIELD( type, TypeParser ); SENF_PARSER_FIELD( length, LengthParser ); SENF_PARSER_FINALIZE(TLVPacketParser); @@ -110,14 +105,13 @@ namespace senf { \ingroup protocolbundle_mpegdvb */ - template + template struct TLVPacketType : public PacketTypeBase { -#ifndef DOXYGEN - typedef ConcretePacket > packet; - typedef TLVPacketParser parser; -#endif + typedef ConcretePacket > packet; + typedef TLVPacketParser parser; + static optional_range nextPacketRange(packet p); static size_type initSize(); @@ -125,13 +119,8 @@ namespace senf { static void dump(packet p, std::ostream & os); }; - - typedef TLVPacketType::packet TLVPacket; - typedef ConcretePacket > TLVFix8Packet; - typedef ConcretePacket > TLVFix16Packet; - typedef ConcretePacket > TLVFix24Packet; - typedef ConcretePacket > TLVFix32Packet; + typedef ConcretePacket > MIHInfoElement; }