From: g0dil Date: Mon, 9 Aug 2010 12:25:20 +0000 (+0000) Subject: Rename PacketRegistry::RegistrationProxy to ScopedRegistrationProxy X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=3f1ea160b4bd47e86e299c7aa528870747f10a05;p=senf.git Rename PacketRegistry::RegistrationProxy to ScopedRegistrationProxy git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@1667 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/senf/Packets/Packet.test.cc b/senf/Packets/Packet.test.cc index aeca47d..a8cba98 100644 --- a/senf/Packets/Packet.test.cc +++ b/senf/Packets/Packet.test.cc @@ -106,8 +106,8 @@ namespace { typedef BarPacketType::packet BarPacket; namespace reg { - senf::PacketRegistry::RegistrationProxy registerFoo(1u); - senf::PacketRegistry::RegistrationProxy registerBar(2u); + senf::PacketRegistry::ScopedRegistrationProxy registerFoo(1u); + senf::PacketRegistry::ScopedRegistrationProxy registerBar(2u); } struct IntAnnotation { diff --git a/senf/Packets/PacketRegistry.cti b/senf/Packets/PacketRegistry.cti index 89b4868..b70af2a 100644 --- a/senf/Packets/PacketRegistry.cti +++ b/senf/Packets/PacketRegistry.cti @@ -31,19 +31,19 @@ ///////////////////////////////PacketRegistry..p/////////////////////////////////////// /////////////////////////////////////////////////////////////////////////// -// senf::PacketRegistry::RegistrationProxy +// senf::PacketRegistry::ScopedRegistrationProxy template template -prefix_ senf::PacketRegistry::RegistrationProxy:: -RegistrationProxy(typename Tag::key_t key, int priority) +prefix_ senf::PacketRegistry::ScopedRegistrationProxy:: +ScopedRegistrationProxy(typename Tag::key_t key, int priority) { PacketRegistry::template registerPacket(key,priority); } template template -prefix_ senf::PacketRegistry::RegistrationProxy::~RegistrationProxy() +prefix_ senf::PacketRegistry::ScopedRegistrationProxy::~ScopedRegistrationProxy() { try { PacketRegistry::template unregisterPacket(); diff --git a/senf/Packets/PacketRegistry.hh b/senf/Packets/PacketRegistry.hh index 497c143..a82e7b3 100644 --- a/senf/Packets/PacketRegistry.hh +++ b/senf/Packets/PacketRegistry.hh @@ -97,7 +97,7 @@ namespace senf { directly, define a symbol in the following way: \code namespace { - senf::PacketRegistry::RegistrationProxy + senf::PacketRegistry::ScopedRegistrationProxy registerPacketType (key, optional_priority); } \endcode @@ -110,10 +110,10 @@ namespace senf { of \c registerPacketType ends. */ template - struct RegistrationProxy + struct ScopedRegistrationProxy { - RegistrationProxy(typename Tag::key_t key, int priority=0); - ~RegistrationProxy(); + ScopedRegistrationProxy(typename Tag::key_t key, int priority=0); + ~ScopedRegistrationProxy(); }; /** \brief Register new packet type @@ -233,7 +233,7 @@ namespace senf { */ # define SENF_PACKET_REGISTRY_REGISTER( registry, value, type ) \ namespace { \ - senf::PacketRegistry< registry >::RegistrationProxy< type > \ + senf::PacketRegistry< registry >::ScopedRegistrationProxy< type > \ BOOST_PP_CAT(packetRegistration_, __LINE__) ( value ); \ } @@ -247,7 +247,7 @@ namespace senf { */ # define SENF_PACKET_REGISTRY_REGISTER_PRIORITY( registry, value, priority, type ) \ namespace { \ - senf::PacketRegistry< registry >::RegistrationProxy< type > \ + senf::PacketRegistry< registry >::ScopedRegistrationProxy< type > \ BOOST_PP_CAT(packetRegistration_, __LINE__) ( value, priority ); \ } diff --git a/senf/Packets/PacketRegistry.test.cc b/senf/Packets/PacketRegistry.test.cc index 38e669c..8dd410d 100644 --- a/senf/Packets/PacketRegistry.test.cc +++ b/senf/Packets/PacketRegistry.test.cc @@ -72,7 +72,7 @@ SENF_AUTO_UNIT_TEST(packetRegistry_test) { PacketRegistry::registerPacket("bar"); PacketRegistry::registerPacket(1u); - senf::PacketRegistry::RegistrationProxy registerBarInBase (2u); + senf::PacketRegistry::ScopedRegistrationProxy registerBarInBase (2u); BOOST_CHECK_EQUAL( PacketRegistry::key(), 1u ); BOOST_CHECK_EQUAL( PacketRegistry::key(), 2u );