git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@839
270642c3-0616-0410-b53a-bc976706d245
#include <map>
#include <boost/utility.hpp> // for boost::noncopyable
#include <boost/optional.hpp>
+#include <boost/preprocessor/cat.hpp>
#include "../Utils/Exception.hh"
#include "Packet.hh"
# define SENF_PACKET_REGISTRY_REGISTER( registry, value, type ) \
namespace { \
senf::PacketRegistry< registry >::RegistrationProxy< type > \
- packetRegistration_ ## __LINE__ ( value ); \
+ BOOST_PP_CAT(packetRegistration_, __LINE__) ( value ); \
}
/** \brief Dump all packet registries
struct OtherPacketType : public PacketTypeBase {};
typedef senf::ConcretePacket<OtherPacketType> OtherPacket;
- namespace reg {
- PacketRegistry<StringTag>::RegistrationProxy<FooPacket> registerFoo ("foo");
- PacketRegistry<StringTag>::RegistrationProxy<BarPacket> registerBar ("bar");
- }
-
}
+SENF_PACKET_REGISTRY_REGISTER(StringTag, "foo", FooPacket);
+SENF_PACKET_REGISTRY_REGISTER(StringTag, "bar", BarPacket);
+
BOOST_AUTO_UNIT_TEST(packetRegistry_test)
{
PacketRegistry<BaseTag>::registerPacket<FooPacket>(1u);