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

The system context holds root supervisor_t (intrusive pointer) and may be loop-related details in derived classes. More...

#include <system_context.h>

Inheritance diagram for rotor::system_context_t:
rotor::asio::system_context_asio_t rotor::thread::system_context_thread_t rotor::wx::system_context_wx_t

Public Member Functions

template<typename Supervisor = supervisor_t>
auto create_supervisor ()
 returns builder for root supervisor
 
supervisor_ptr_t get_supervisor () noexcept
 returns root supervisor
 
 system_context_t (const system_context_t &)=delete
 
 system_context_t (system_context_t &&)=delete
 
virtual void on_error (actor_base_t *actor, const extended_error_ptr_t &ec) noexcept
 fatal error handler
 
virtual std::string identity () noexcept
 identifies the context.
 
template<typename T >
auto & access () noexcept
 generic non-public fields accessor
 
const message_stringifier_tget_stringifier ()
 returns the default stringifier
 

Protected Member Functions

virtual message_stringifier_ptr_t make_stringifier () const noexcept
 constructs message stringifier
 

Friends

struct supervisor_t
 

Detailed Description

The system context holds root supervisor_t (intrusive pointer) and may be loop-related details in derived classes.

Member Function Documentation

◆ get_stringifier()

const message_stringifier_t & rotor::system_context_t::get_stringifier ( )

returns the default stringifier

The stringifier is lazily constructed on demand via make_stringifier method.

◆ identity()

virtual std::string rotor::system_context_t::identity ( )
virtualnoexcept

identifies the context.

By default, is is just human-readable address of the system context

◆ on_error()

virtual void rotor::system_context_t::on_error ( actor_base_t actor,
const extended_error_ptr_t ec 
)
virtualnoexcept

fatal error handler

The error is fatal, is further rotor behavior is undefined. The method should be overriden in derived classes for error propagation/notification. The default implementation is to output the error to std::err and invoke std::abort().


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