Packets: Fix VariantParser invalid parser access bug
[senf.git] / Packets / PacketInterpreter.hh
index 68af3da..66fc03f 100644 (file)
@@ -23,8 +23,8 @@
 /** \file
     \brief PacketInterpreter public header */
 
-#ifndef HH_PacketInterpreter_
-#define HH_PacketInterpreter_ 1
+#ifndef HH_SENF_Packets_PacketInterpreter_
+#define HH_SENF_Packets_PacketInterpreter_ 1
 
 // Custom includes
 #include "../boost/intrusive/ilist.hpp"
@@ -162,11 +162,20 @@ namespace senf {
         
         ///@}
 
+        ///\name Annotations
+        ///@{
+
+        template <class Annotation>
+        Annotation & annotation();
+
+        ///@}
+
         ///\name Access to the abstract interface
         ///@{
 
         optional_range nextPacketRange();
-        void finalize();
+        void finalizeThis();
+        void finalizeTo(ptr other);
         void dump(std::ostream & os);
         TypeIdValue typeId();
         factory_t factory();
@@ -211,7 +220,7 @@ namespace senf {
         void releaseImpl();
 
         friend class detail::PacketImpl;
-        friend class intrusive_refcount_t<PacketInterpreterBase>;
+        friend class intrusive_refcount_base;
         template <class PacketType> friend class PacketInterpreter;
         friend class detail::packet::test::TestDriver;
         friend class PacketParserBase;
@@ -379,15 +388,15 @@ namespace senf {
         This exception signals an invalid operation on the chain like trying to find a non-existent
         chain member and other similar error conditions. 
      */
-    struct InvalidPacketChainException : public std::exception
-    { virtual char const * what() const throw() { return "invalid packet chain"; } };
+    struct InvalidPacketChainException : public senf::Exception
+    { InvalidPacketChainException() : senf::Exception("invalid packet chain"){} };
     
 }
 
 ///////////////////////////////hh.e////////////////////////////////////////
 #endif
-#if !defined(HH_Packets__decls_) && !defined(HH_PacketInterpreter_i_)
-#define HH_PacketInterpreter_i_
+#if !defined(HH_SENF_Packets_Packets__decls_) && !defined(HH_SENF_Packets_PacketInterpreter_i_)
+#define HH_SENF_Packets_PacketInterpreter_i_
 #include "PacketInterpreter.cci"
 #include "PacketInterpreter.ct"
 #include "PacketInterpreter.cti"