rotor
Event loop friendly C++ actor micro-framework
 
Loading...
Searching...
No Matches
rotor::handler_t< Handler, std::enable_if_t< details::is_actor_handler_v< Handler > > > Struct Template Referencefinal

the actor handler meant to hold user-specific pointer-to-member function More...

#include <handler.h>

Inheritance diagram for rotor::handler_t< Handler, std::enable_if_t< details::is_actor_handler_v< Handler > > >:
rotor::handler_base_t

Public Member Functions

 handler_t (actor_base_t &actor, Handler &&handler_)
 constructs handler from actor & pointer-to-member function

 
void call (message_ptr_t &message) noexcept override
 attempt to delivery message to the handler
 
bool select (message_ptr_t &message) noexcept override
 returns true if the message can be handled by the handler
 
void call_no_check (message_ptr_t &message) noexcept override
 unconditionally invokes the handler for the message
 
const void * message_type () const noexcept override
 unique per-message-type pointer used for routing
 
- Public Member Functions inherited from rotor::handler_base_t
 handler_base_t (actor_base_t &actor, const void *handler_type_) noexcept
 constructs handler_base_t from raw pointer to actor, raw pointer to message type and raw pointer to handler type
 
bool operator== (const handler_base_t &rhs) const noexcept
 compare two handler for equality
 
virtual handler_ptr_t upgrade (const void *tag) noexcept
 "upgrades" handler by tagging it
 

Public Attributes

Handler handler
 pointer-to-member function instance
 
- Public Attributes inherited from rotor::handler_base_t
const void * handler_type
 pointer to unique handler type ( typeid(Handler).name() )
 
actor_base_tactor_ptr
 non-null pointer to actor_base_t the actor of the handler,

 
size_t precalc_hash
 precalculated hash for the handler
 

Static Public Attributes

static const void * handler_type
 static pointer to unique pointer-to-member function name ( typeid(Handler).name() )
 

Detailed Description

template<typename Handler>
struct rotor::handler_t< Handler, std::enable_if_t< details::is_actor_handler_v< Handler > > >

the actor handler meant to hold user-specific pointer-to-member function

Template Parameters
Handlerpointer-to-member function type

Member Function Documentation

◆ call()

template<typename Handler >
void rotor::handler_t< Handler, std::enable_if_t< details::is_actor_handler_v< Handler > > >::call ( message_ptr_t )
inlineoverridevirtualnoexcept

attempt to delivery message to the handler

The message is delivered only if its type matches to the handler message type, otherwise it is silently ignored

Implements rotor::handler_base_t.

◆ call_no_check()

template<typename Handler >
void rotor::handler_t< Handler, std::enable_if_t< details::is_actor_handler_v< Handler > > >::call_no_check ( message_ptr_t )
inlineoverridevirtualnoexcept

unconditionally invokes the handler for the message

It assumes that the handler is able to handle the message. See select method.

Implements rotor::handler_base_t.

◆ message_type()

template<typename Handler >
const void * rotor::handler_t< Handler, std::enable_if_t< details::is_actor_handler_v< Handler > > >::message_type ( ) const
inlineoverridevirtualnoexcept

unique per-message-type pointer used for routing

Implements rotor::handler_base_t.

◆ select()

template<typename Handler >
bool rotor::handler_t< Handler, std::enable_if_t< details::is_actor_handler_v< Handler > > >::select ( message_ptr_t )
inlineoverridevirtualnoexcept

returns true if the message can be handled by the handler

Implements rotor::handler_base_t.


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