rotor_light
real-time C++ actor micro-framework for embedded systems, supervisable
All Classes Namespaces Files Functions Variables Typedefs Pages
rotor_light::Supervisor< HandlersCount, Actors > Struct Template Reference

convenient templated base class for supervisor, which owns (stores) all it's child-actors More...

#include <supervisor.hpp>

Inheritance diagram for rotor_light::Supervisor< HandlersCount, Actors >:
rotor_light::SupervisorBase rotor_light::ActorBase

Public Member Functions

template<size_t ChildIndex>
auto get_child ()
 
- Public Member Functions inherited from rotor_light::SupervisorBase
 SupervisorBase (char *backends, size_t backends_count, ActorBase **actors, details::ChildState *states, size_t actors_count)
 
QueueBaseget_queue ()
 
void initialize () override
 
void start (bool poll_timer=false)
 starts all actors (initialize, wait confirmation etc.) More...
 
virtual void bind (Context &context, ActorId value=0)
 
uint8_t bind (ActorId initial_value, SupervisorBase *supervisor, Context &context) override
 
void process ()
 
void advance_init () override
 
void advance_start () override
 
void advance_stop () override
 
PlannerBaseget_planner ()
 
- Public Member Functions inherited from rotor_light::ActorBase
 ActorBase (const ActorBase &)=delete
 
 ActorBase (ActorBase &&)=delete
 
virtual void initialize ()
 
virtual uint8_t bind (ActorId initial_value, SupervisorBase *supervisor, Context &context)
 
ActorId get_id () const
 
State get_state () const
 
FailPolicy get_fail_policy () const
 
void set_fail_policy (FailPolicy value)
 
void stop ()
 
template<typename Ctx >
EventId add_event (Duration delta, Callback callback, void *data)
 
void cancel_event (EventId event_id)
 
template<typename Ctx , typename MessageType , typename... Args>
bool send (size_t queue_index, Args... args)
 emplaces new message into appropriate queue More...
 
template<typename Method >
void subscribe (Method method)
 

Protected Types

using ActorsList = std::tuple< Actors... >
 

Protected Attributes

ActorsList children
 
ActorBase::Handler backends [HandlersCount]
 
ActorBaseactors [children_count+1]
 
details::ChildState children_states_holder [children_count+1]
 
- Protected Attributes inherited from rotor_light::SupervisorBase
ActorBase ** actors
 
details::ChildStatestates
 
size_t actors_count
 
QueueBasequeue
 
PlannerBaseplanner
 
NowFunction now
 
- Protected Attributes inherited from rotor_light::ActorBase
ActorId id
 
ActorId mask
 
State state = State::off
 
SupervisorBasesupervisor
 
FailPolicy fail_policy
 

Static Protected Attributes

static constexpr size_t children_count = std::tuple_size_v<ActorsList>
 

Additional Inherited Members

- Public Types inherited from rotor_light::SupervisorBase
using Parent = ActorBase
 
- Public Types inherited from rotor_light::ActorBase
using GenericMethod = void(ActorBase::*)(Message &)
 alias for generic message handler
 
using MethodEntry = void(*)(Message &, ActorBase &, Handler &)
 alias for method entry, enough to actually perfrom message delivery
 
- Static Public Attributes inherited from rotor_light::SupervisorBase
static constexpr size_t min_handlers_amount
 
- Static Public Attributes inherited from rotor_light::ActorBase
static constexpr size_t min_handlers_amount = 1
 
- Protected Member Functions inherited from rotor_light::SupervisorBase
virtual void on_refhesh_timer (message::RefreshTime &)
 
- Protected Member Functions inherited from rotor_light::ActorBase
 ActorBase (char *backends, size_t backends_count)
 
virtual void advance_init ()
 
virtual void advance_start ()
 
virtual void advance_stop ()
 

Detailed Description

template<size_t HandlersCount, typename... Actors>
struct rotor_light::Supervisor< HandlersCount, Actors >

convenient templated base class for supervisor, which owns (stores) all it's child-actors

Member Typedef Documentation

◆ ActorsList

template<size_t HandlersCount, typename... Actors>
using rotor_light::Supervisor< HandlersCount, Actors >::ActorsList = std::tuple<Actors...>
protected

heterogenious / type-friendly container for child actors (type)

Member Function Documentation

◆ get_child()

template<size_t HandlersCount, typename... Actors>
template<size_t ChildIndex>
auto rotor_light::Supervisor< HandlersCount, Actors >::get_child ( )
inline

returns child actor by indes

Member Data Documentation

◆ actors

template<size_t HandlersCount, typename... Actors>
ActorBase* rotor_light::Supervisor< HandlersCount, Actors >::actors[children_count+1]
protected

pointers to actors, including self. Needed to be processed uniformly

◆ backends

template<size_t HandlersCount, typename... Actors>
ActorBase::Handler rotor_light::Supervisor< HandlersCount, Actors >::backends[HandlersCount]
protected

message handlers storage

◆ children

template<size_t HandlersCount, typename... Actors>
ActorsList rotor_light::Supervisor< HandlersCount, Actors >::children
protected

heterogenious / type-friendly container for child actors

◆ children_count

template<size_t HandlersCount, typename... Actors>
constexpr size_t rotor_light::Supervisor< HandlersCount, Actors >::children_count = std::tuple_size_v<ActorsList>
staticconstexprprotected

count of child actors

◆ children_states_holder

template<size_t HandlersCount, typename... Actors>
details::ChildState rotor_light::Supervisor< HandlersCount, Actors >::children_states_holder[children_count+1]
protected

child actors states, including self


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