use unittest include from util!
[senf.git] / Packets / MPEGDVBBundle / TransportPacket.hh
index 6e9caa2..2bf00b3 100644 (file)
@@ -1,8 +1,8 @@
 // $Id:TransportPacket.hh 560 2007-12-13 14:39:37Z tho $
 //
 // Copyright (C) 2007
-// Fraunhofer Institute for Open Communication Systems (FOKUS) 
-// Competence Center NETwork research (NET), St. Augustin, GERMANY 
+// Fraunhofer Institute for Open Communication Systems (FOKUS)
+// Competence Center NETwork research (NET), St. Augustin, GERMANY
 //     Thorsten Horstmann <tho@berlios.de>
 //
 // This program is free software; you can redistribute it and/or modify
@@ -56,6 +56,12 @@ namespace senf {
         SENF_PARSER_BITFIELD ( continuity_counter,          4, unsigned );
 
         SENF_PARSER_FINALIZE( TransportPacketParser );
+        
+        void init_fields() const;
+        SENF_PARSER_INIT() {
+            defaultInit();
+            init_fields();
+        }
     
 //        UInt8Parser payload_pointer() const {
 //            return parse<UInt8Parser>( TransportPacketParser::fixed_bytes ); 
@@ -119,13 +125,11 @@ namespace senf {
         using mixin::initSize;
         
         static void dump(packet p, std::ostream & os);
+        static const byte SYNC_BYTE = 0x47;
     };
     
     /** \brief Transport packet typedef */
-    typedef TransportPacketType::packet TransportPacket;
-    
-    #define TRANSPORT_PACKET_SYNC_BYTE 0x47
-  
+    typedef ConcretePacket<TransportPacketType> TransportPacket;
 }