senf::PacketRegistry< Tag >::PacketRegistry::ScopedRegistrationProxy< PacketType > Struct Template Reference

Statically register a packet type in a PacketRegistry. More...

#include <senf/Packets/PacketRegistry.hh>

List of all members.


Detailed Description

template<class Tag>
template<class PacketType>
struct senf::PacketRegistry< Tag >::ScopedRegistrationProxy< PacketType >

Statically register a packet type in a PacketRegistry.

This class is normally used via SENF_PACKET_REGISTRY_REGISTER. To use this class directly, define a symbol in the following way:

namespace {
    senf::PacketRegistry<Tag>::ScopedRegistrationProxy<PacketType>
        registerPacketType (key, optional_priority);
}
Here Tag is the type tag of the registry to register the packet in, PacketType is the packet to register (this is the ConcretePacket of that packet) and key is the key of type Tag::key_t under which the packet is to be registered. registerPacketType is an arbitrary name for the global symbol.

The packet will be registered in the constructor and will be unregistered when the scope of registerPacketType ends.

Definition at line 113 of file PacketRegistry.hh.


Public Member Functions

  ScopedRegistrationProxy (typename Tag::key_t key, int priority=0)
  ~ScopedRegistrationProxy ()

Constructor & Destructor Documentation

template<class Tag>
template<class PacketType >
senf::PacketRegistry< Tag >::PacketRegistry::ScopedRegistrationProxy< PacketType >::
ScopedRegistrationProxy ( typename Tag::key_t  key,
int  priority = 0 )

Definition at line 39 of file PacketRegistry.cti.

template<class Tag >
template<class PacketType >
senf::PacketRegistry< Tag >::PacketRegistry::ScopedRegistrationProxy< PacketType >::~
~ScopedRegistrationProxy ()

Definition at line 46 of file PacketRegistry.cti.


The documentation for this struct was generated from the following files: