eventbus
dp::handler_registration Class Reference

A registration handle for a particular handler of an event type. More...

#include <event_bus.hpp>

Public Member Functions

 handler_registration (const handler_registration &other)=delete
 
 handler_registration (handler_registration &&other) noexcept
 
handler_registrationoperator= (const handler_registration &other)=delete
 
handler_registrationoperator= (handler_registration &&other) noexcept
 
 ~handler_registration ()
 
const void * handle () const
 Pointer to the underlying handle. More...
 
void unregister () noexcept
 Unregister this handler from the event bus. More...
 

Protected Member Functions

 handler_registration (const void *handle, dp::event_bus *bus)
 

Friends

class event_bus
 

Detailed Description

A registration handle for a particular handler of an event type.

This class is move constructible only. It also assumed that the lifespan of this object will be as long or shorter than that of the event bus. This class is move constructible for that reason, but there are still some cases where you can run into life time issues.

Constructor & Destructor Documentation

◆ handler_registration() [1/3]

dp::handler_registration::handler_registration ( const handler_registration other)
delete

◆ handler_registration() [2/3]

dp::handler_registration::handler_registration ( handler_registration &&  other)
inlinenoexcept

◆ ~handler_registration()

dp::handler_registration::~handler_registration ( )
inline

◆ handler_registration() [3/3]

dp::handler_registration::handler_registration ( const void *  handle,
dp::event_bus bus 
)
inlineprotected

Member Function Documentation

◆ handle()

const void * dp::handler_registration::handle ( ) const
inline

Pointer to the underlying handle.

◆ operator=() [1/2]

handler_registration& dp::handler_registration::operator= ( const handler_registration other)
delete

◆ operator=() [2/2]

handler_registration & dp::handler_registration::operator= ( handler_registration &&  other)
inlinenoexcept

◆ unregister()

void dp::handler_registration::unregister ( )
inlinenoexcept

Unregister this handler from the event bus.

Friends And Related Function Documentation

◆ event_bus

friend class event_bus
friend

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