X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Packets%2FPacketRegistry.hh;h=04e3177d55fa39beb99b0da1f970f3159755a4a4;hb=3a1b45cae9d48b1d53fc310e2a283d2b9d17275e;hp=6c76021f022939f954be1b6ebcf0904c6ab8f6f9;hpb=f73fa16ed5abdce272ac77f8b8b9ef2b9922c266;p=senf.git diff --git a/Packets/PacketRegistry.hh b/Packets/PacketRegistry.hh index 6c76021..04e3177 100644 --- a/Packets/PacketRegistry.hh +++ b/Packets/PacketRegistry.hh @@ -193,6 +193,19 @@ packet of which the key is requested static Registry & registry(); }; + /** \brief Statically add an entry to a packet registry + + 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. + + \hideinitializer + */ +# define SENF_PACKET_REGISTRY_REGISTER( registry, value, type ) \ + namespace { \ + senf::PacketRegistry< registry >::RegistrationProxy< type > \ + packetRegistration_ ## __LINE__ ( value ); \ + } + /** \brief Entry not found in registry This exception is signaled whenever a throwing lookup operation fails.