Packets: Implement PacketRegistry priority support
[senf.git] / senf / Packets / PacketRegistry.hh
index 882f693..beb3384 100644 (file)
@@ -78,7 +78,7 @@ namespace senf {
         static registration only works when the symbol is included into the final binary. To force
         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);
@@ -91,6 +91,7 @@ namespace senf {
     {
     public:
         typedef typename detail::PacketRegistryImpl<typename Tag::key_t>::iterator iterator;
+        typedef typename detail::PacketRegistryImpl<typename Tag::key_t>::Entry Entry;
 
         /** \brief Statically register a packet type in a PacketRegistry
 
@@ -109,6 +110,7 @@ namespace senf {
         struct RegistrationProxy
         {
             RegistrationProxy(typename Tag::key_t key);
+            ~RegistrationProxy();
         };
 
         /** \brief Register new packet type
@@ -126,6 +128,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
@@ -175,13 +181,13 @@ namespace senf {
             \throws PacketTypeNotRegistered if the \a key is not found in the registry
             \return %Packet entry for given \a key
          */
-        static PkReg_Entry const & lookup(typename Tag::key_t key);
+        static Entry const & lookup(typename Tag::key_t key);
 
         /** \brief Lookup a packet by it's key
             \return Pointer to packet entry for given \a key or 0, if the key is not found in the
                 registry.
          */
-        static PkReg_Entry const * lookup(typename Tag::key_t key, NoThrow_t);
+        static Entry const * lookup(typename Tag::key_t key, NoThrow_t);
 
         /** \brief Beginning iterator to list of registered keys
          */
@@ -245,4 +251,3 @@ namespace senf {
 // compile-command: "scons -u test"
 // comment-column: 40
 // End:
-