rotor
Event loop friendly C++ actor micro-framework
 
Loading...
Searching...
No Matches
rotor::handler_base_t Struct Referenceabstract

Base class for rotor handler, i.e concrete message type processing point on concrete actor. More...

#include <handler.h>

Inheritance diagram for rotor::handler_base_t:
rotor::handler_intercepted_t rotor::handler_t< Handler, std::enable_if_t< details::is_actor_handler_v< Handler > > > rotor::handler_t< Handler, std::enable_if_t< details::is_plugin_handler_v< Handler > > > rotor::handler_t< lambda_holder_t< Handler, M >, std::enable_if_t< details::is_lambda_handler_v< lambda_holder_t< Handler, M > > > >

Public Member Functions

 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 void call (message_ptr_t &) noexcept=0
 attempt to delivery message to the handler
 
virtual handler_ptr_t upgrade (const void *tag) noexcept
 "upgrades" handler by tagging it
 
virtual bool select (message_ptr_t &) noexcept=0
 returns true if the message can be handled by the handler
 
virtual void call_no_check (message_ptr_t &) noexcept=0
 unconditionally invokes the handler for the message
 
virtual const void * message_type () const noexcept=0
 unique per-message-type pointer used for routing
 

Public Attributes

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
 

Detailed Description

Base class for rotor handler, i.e concrete message type processing point on concrete actor.

It holds reference to actor_base_t.

Member Function Documentation

◆ call()

virtual void rotor::handler_base_t::call ( message_ptr_t )
pure virtualnoexcept

◆ call_no_check()

virtual void rotor::handler_base_t::call_no_check ( message_ptr_t )
pure virtualnoexcept

◆ message_type()

◆ select()

◆ upgrade()

virtual handler_ptr_t rotor::handler_base_t::upgrade ( const void *  tag)
virtualnoexcept

"upgrades" handler by tagging it

Conceptually it intercepts handler call and does tag-specific actions

Reimplemented in rotor::handler_intercepted_t.


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