X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Packets%2FPacketType.hh;h=e9d0d30ffb7d093fd3bd4eacd349ec6429935fef;hb=844ac7af0a15ed6c487bc9928148ac38a2ce4025;hp=e23ef09cc57ff8d7da2e06c3743ffbd6f01d9860;hpb=37c00b11c3d5c794463bbe7fc709674cca8579d3;p=senf.git diff --git a/Packets/PacketType.hh b/Packets/PacketType.hh index e23ef09..e9d0d30 100644 --- a/Packets/PacketType.hh +++ b/Packets/PacketType.hh @@ -263,7 +263,7 @@ namespace senf { // member. } - static registry_key_t nextPacketKey(packet p) + static key_t nextPacketKey(packet p) { // Return the key in the registry under which the next packet // header is to be found. This member must be given if a Registry argument is @@ -306,7 +306,7 @@ namespace senf { using mixin::initSize; using mixin::init; - static registry_key_t nextPacketKey(packet p) + static key_t nextPacketKey(packet p) { return p->typeField(); } }; \endcode @@ -320,10 +320,10 @@ namespace senf { class PacketTypeMixin { public: - typedef typename Registry::key_t registry_key_t; - typedef boost::optional optional_registry_key_t; + typedef typename Registry::key_t key_t; + typedef boost::optional optional_key_t; - static optional_registry_key_t key (Packet p); ///< Find key of packet from registry + static optional_key_t key (Packet p); ///< Find key of packet from registry /**< key() will query the registry to find the key of the given packet. Whereas \c nextPacketKey() as implemented by the mixin user will provide the registry key of the @@ -336,6 +336,11 @@ namespace senf { type is not found in the registry, the returned optional value will be empty. */ + static PacketTypeBase::factory_t lookup (key_t key); ///< Lookup the key in the registry + /**< lookup() will query the registry and find the factory + for the given key. If the key cannot be found, + no_factory() will be returned. */ + ///\name PacketType interface implementation ///@{