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

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

#include <senf/Packets/PacketRegistry.hh>

Public Member Functions

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

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 {
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 104 of file PacketRegistry.hh.

Constructor & Destructor Documentation

◆ ScopedRegistrationProxy()

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

◆ ~ScopedRegistrationProxy()

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

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