17 #ifndef HH_SENF_Packets_PacketRegistry_ 18 #define HH_SENF_Packets_PacketRegistry_ 1 21 #include <boost/optional.hpp> 22 #include <boost/preprocessor/cat.hpp> 83 typedef typename detail::PacketRegistryImpl<typename Tag::key_t>::Entry
Entry;
103 template <
class PacketType>
123 template <
class PacketType>
133 template <
class PacketType>
155 template <
class PacketType>
156 static typename Tag::key_t
key();
167 template <
class PacketType>
168 static typename boost::optional<typename Tag::key_t>
key(
NoThrow_t);
178 static typename Tag::key_t
key(
Packet const & packet);
189 static typename boost::optional<typename Tag::key_t>
key(
Packet const & packet,
NoThrow_t);
196 static Entry
const &
lookup(
typename Tag::key_t key);
206 static iterator
begin();
210 static iterator
end();
218 typedef detail::PacketRegistryImpl<typename Tag::key_t> Registry;
219 static Registry & registry();
233 # define SENF_PACKET_REGISTRY_REGISTER( registry, value, type ) \ 235 senf::PacketRegistry< registry >::ScopedRegistrationProxy< type > \ 236 BOOST_PP_CAT(packetRegistration_, __LINE__) ( value ); \ 247 # define SENF_PACKET_REGISTRY_REGISTER_PRIORITY( registry, value, priority, type ) \ 249 senf::PacketRegistry< registry >::ScopedRegistrationProxy< type > \ 250 BOOST_PP_CAT(packetRegistration_, __LINE__) ( value, priority ); \ 271 #if !defined(HH_SENF_Packets_Packets__decls_) && !defined(HH_SENF_Packets_PacketRegistry_i_) 272 #define HH_SENF_Packets_PacketRegistry_i_
detail::PacketRegistryImpl< typename Tag::key_t >::iterator iterator
void dumpPacketRegistries(std::ostream &os)
Dump all packet registries.
static void registerPacket(typename Tag::key_t key, int priority=0)
Register new packet type.
Statically register a packet type in a PacketRegistry.
static iterator begin()
Beginning iterator to list of registered entries.
raw_container::iterator iterator
detail::PacketRegistryImpl< typename Tag::key_t >::Entry Entry
static Entry const & lookup(typename Tag::key_t key)
Lookup a packet by it's key.
~ScopedRegistrationProxy()
ScopedRegistrationProxy(typename Tag::key_t key, int priority=0)
static void unregisterPacket()
Unregister packet by packet type.
static iterator end()
End iterator to list of registered entries.
Packet registration facility
static Tag::key_t key()
Find key of a packet type.
PacketTypeNotRegisteredException()
Entry not found in registry.