Packets: Packet Registry unregister() support
[senf.git] / senf / Packets / PacketRegistry.hh
index 932dfec..e766914 100644 (file)
@@ -79,6 +79,11 @@ namespace senf {
         this inclusion, you should not put packet registrations into a library but into an object
         file.
 
+        To simplify static registration the SENF_PACKET_REGISTRY_REGISTER macro can be used:
+        \code
+        SENF_PACKET_REGISTRY_REGISTER(SomeTag, SomePacket, key_of_somePacket);
+        \endcode
+
         \ingroup packet_module
      */
     template <class Tag>
@@ -104,6 +109,7 @@ namespace senf {
         struct RegistrationProxy
         {
             RegistrationProxy(typename Tag::key_t key);
+            ~RegistrationProxy();
         };
 
         /** \brief Register new packet type
@@ -121,6 +127,10 @@ namespace senf {
         template <class PacketType>
         static void registerPacket(typename Tag::key_t key);
 
+        template <class PacketType>
+        static void unregisterPacket();
+        static void unregisterPacket(typename Tag::key_t key);
+
         /** \brief Find key of a packet type
 
             Return the key of \a PacketType as registered in the \a Tag registry
@@ -196,6 +206,7 @@ namespace senf {
         This macro will declare an anonymous global variable in such a way, that constructing this
         variable will add a registration to the given packet registry.
 
+        \ingroup packet_module
         \hideinitializer
      */
 #   define SENF_PACKET_REGISTRY_REGISTER( registry, value, type )                                 \
@@ -216,7 +227,7 @@ namespace senf {
         This exception is signaled whenever a throwing lookup operation fails.
      */
     struct PacketTypeNotRegisteredException : public senf::Exception
-    { PacketTypeNotRegisteredException() : senf::Exception("packet type not registered"){} };
+    { PacketTypeNotRegisteredException() : senf::Exception("packet type not registered") {} };
 
 }
 
@@ -229,7 +240,7 @@ namespace senf {
 #include "PacketRegistry.cti"
 #endif
 
-
+\f
 // Local Variables:
 // mode: c++
 // fill-column: 100
@@ -239,4 +250,3 @@ namespace senf {
 // compile-command: "scons -u test"
 // comment-column: 40
 // End:
-