typedef BarPacketType::packet BarPacket;
namespace reg {
- senf::PacketRegistry<RegTag>::RegistrationProxy<FooPacket> registerFoo(1u);
- senf::PacketRegistry<RegTag>::RegistrationProxy<BarPacket> registerBar(2u);
+ senf::PacketRegistry<RegTag>::ScopedRegistrationProxy<FooPacket> registerFoo(1u);
+ senf::PacketRegistry<RegTag>::ScopedRegistrationProxy<BarPacket> registerBar(2u);
}
struct IntAnnotation {
///////////////////////////////PacketRegistry..p///////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
-// senf::PacketRegistry<Tag>::RegistrationProxy<PacketType>
+// senf::PacketRegistry<Tag>::ScopedRegistrationProxy<PacketType>
template <class Tag>
template <class PacketType>
-prefix_ senf::PacketRegistry<Tag>::RegistrationProxy<PacketType>::
-RegistrationProxy(typename Tag::key_t key, int priority)
+prefix_ senf::PacketRegistry<Tag>::ScopedRegistrationProxy<PacketType>::
+ScopedRegistrationProxy(typename Tag::key_t key, int priority)
{
PacketRegistry<Tag>::template registerPacket<PacketType>(key,priority);
}
template <class Tag>
template <class PacketType>
-prefix_ senf::PacketRegistry<Tag>::RegistrationProxy<PacketType>::~RegistrationProxy()
+prefix_ senf::PacketRegistry<Tag>::ScopedRegistrationProxy<PacketType>::~ScopedRegistrationProxy()
{
try {
PacketRegistry<Tag>::template unregisterPacket<PacketType>();
directly, define a symbol in the following way:
\code
namespace {
- senf::PacketRegistry<Tag>::RegistrationProxy<PacketType>
+ senf::PacketRegistry<Tag>::ScopedRegistrationProxy<PacketType>
registerPacketType (key, optional_priority);
}
\endcode
of \c registerPacketType ends.
*/
template <class PacketType>
- 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
*/
# 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 ); \
}
*/
# 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 ); \
}
{
PacketRegistry<StringTag>::registerPacket<BarPacket>("bar");
PacketRegistry<BaseTag>::registerPacket<FooPacket>(1u);
- senf::PacketRegistry<BaseTag>::RegistrationProxy<BarPacket> registerBarInBase (2u);
+ senf::PacketRegistry<BaseTag>::ScopedRegistrationProxy<BarPacket> registerBarInBase (2u);
BOOST_CHECK_EQUAL( PacketRegistry<BaseTag>::key<FooPacket>(), 1u );
BOOST_CHECK_EQUAL( PacketRegistry<BaseTag>::key<BarPacket>(), 2u );