X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Packets%2FPacketRegistry.hh;h=8233d66c58cbf2f163faa9a6a93ac70348692423;hb=0734bd14c709ca5ba1d0ed69c5b9f5d1487e5faa;hp=5d35eb9892b1f503708fd4199fe8ed67581726fe;hpb=54eed72c506b09ef5b4be0b62fecedfbc0e3f261;p=senf.git diff --git a/Packets/PacketRegistry.hh b/Packets/PacketRegistry.hh index 5d35eb9..8233d66 100644 --- a/Packets/PacketRegistry.hh +++ b/Packets/PacketRegistry.hh @@ -1,9 +1,9 @@ // $Id$ // // Copyright (C) 2006 -// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS) -// Kompetenzzentrum fuer Satelitenkommunikation (SatCom) -// Stefan Bund +// Fraunhofer Institute for Open Communication Systems (FOKUS) +// Competence Center NETwork research (NET), St. Augustin, GERMANY +// Stefan Bund // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -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.