MakerLabs ACM
ActorModel::Node Class Reference

#include <node.h>

Public Types

using string = std::string
 
using string_view = std::experimental::string_view
 
using ProcessPtr = std::unique_ptr< Process >
 
using ProcessRegistry = std::unordered_map< Pid, ProcessPtr, UUID::UUIDHashFunc, UUID::UUIDEqualFunc >
 
using NamedProcessRegistry = std::unordered_map< string, Pid >
 
using ModuleRegistry = std::unordered_map< string, ModuleFlatbuffer >
 
using FunctionRegistry = std::unordered_map< string, FunctionMutableFlatbuffer >
 
using TimedMessages = std::unordered_map< TRef, TimedBufferDelivery >
 
using TimedSignals = std::unordered_map< SignalRef, TimedBufferDelivery >
 

Public Member Functions

 Node ()
 
auto spawn (const Behaviour &&_behaviour, const ExecConfigCallback &&_exec_config_callback) -> Pid
 
auto spawn_link (const Pid &_initial_link_pid, const Behaviour &&_behaviour, const ExecConfigCallback &&_exec_config_callback) -> Pid
 
auto process_flag (const Pid &pid, const ProcessFlag flag, const bool flag_setting) -> bool
 
auto send (const Pid &pid, const Message &message) -> bool
 
auto send (const Pid &pid, const string_view type, const string_view payload) -> bool
 
auto send_after (const Time time, const Pid &pid, const Message &message) -> TRef
 
auto send_after (const Time time, const Pid &pid, const string_view type, const string_view payload) -> TRef
 
auto send_interval (const Time time, const Pid &pid, const Message &message) -> TRef
 
auto send_interval (const Time time, const Pid &pid, const string_view type, const string_view payload) -> TRef
 
auto cancel (const TRef tref) -> bool
 
auto cancel_signal (const SignalRef signal_ref) -> bool
 
auto exit (const Pid &pid, const Pid &pid2, const Reason exit_reason) -> bool
 
auto register_name (const string_view name, const Pid &pid) -> bool
 
auto unregister (const string_view name) -> bool
 
auto registered () -> const NamedProcessRegistry
 
auto whereis (const string_view name) -> MaybePid
 
auto module (const string_view module_flatbuffer) -> bool
 
auto apply (const Pid &pid, const string_view function_name, const string_view args) -> ResultUnion
 
auto apply (const Pid &pid, const string_view module_name, const string_view function_name, const string_view args) -> ResultUnion
 
auto timer_callback (const TRef tref) -> bool
 
auto signal_timer_callback (const SignalRef signal_ref) -> bool
 

Protected Member Functions

auto _spawn (const Behaviour &&_behaviour, const MaybePid &_initial_link_pid=std::experimental::nullopt, const ExecConfigCallback &&_exec_config_callback=nullptr) -> Pid
 
auto terminate (const Pid &pid) -> bool
 
auto signal (const Pid &pid, flatbuffers::DetachedBuffer &&signal_buf) -> SignalRef
 
auto process_signal (const Pid &pid, const Signal &sig) -> bool
 
auto start_timer (const Time time, const Pid &pid, flatbuffers::DetachedBuffer &&message_buf, const bool is_recurring=false) -> TRef
 

Protected Attributes

ProcessRegistry process_registry
 
NamedProcessRegistry named_process_registry
 
ModuleRegistry module_registry
 
FunctionRegistry function_registry
 
TimedMessages timed_messages
 
TRef next_tref = 1
 
TimedSignals timed_signals
 
SignalRef next_signal_ref = 1
 

Friends

class Process
 

Member Typedef Documentation

◆ FunctionRegistry

◆ ModuleRegistry

◆ NamedProcessRegistry

using ActorModel::Node::NamedProcessRegistry = std::unordered_map<string, Pid>

◆ ProcessPtr

using ActorModel::Node::ProcessPtr = std::unique_ptr<Process>

◆ ProcessRegistry

◆ string

using ActorModel::Node::string = std::string

◆ string_view

using ActorModel::Node::string_view = std::experimental::string_view

◆ TimedMessages

◆ TimedSignals

Constructor & Destructor Documentation

◆ Node()

ActorModel::Node::Node ( )

Member Function Documentation

◆ _spawn()

auto ActorModel::Node::_spawn ( const Behaviour &&  _behaviour,
const MaybePid &  _initial_link_pid = std::experimental::nullopt,
const ExecConfigCallback &&  _exec_config_callback = nullptr 
) -> Pid
protected
Here is the call graph for this function:

◆ apply() [1/2]

auto ActorModel::Node::apply ( const Pid &  pid,
const string_view  function_name,
const string_view  args 
) -> ResultUnion

◆ apply() [2/2]

auto ActorModel::Node::apply ( const Pid &  pid,
const string_view  module_name,
const string_view  function_name,
const string_view  args 
) -> ResultUnion
Here is the call graph for this function:

◆ cancel()

auto ActorModel::Node::cancel ( const TRef  tref) -> bool

◆ cancel_signal()

auto ActorModel::Node::cancel_signal ( const SignalRef  signal_ref) -> bool

◆ exit()

auto ActorModel::Node::exit ( const Pid &  pid,
const Pid &  pid2,
const Reason  exit_reason 
) -> bool

◆ module()

auto ActorModel::Node::module ( const string_view  module_flatbuffer) -> bool
Here is the call graph for this function:

◆ process_flag()

auto ActorModel::Node::process_flag ( const Pid &  pid,
const ProcessFlag  flag,
const bool  flag_setting 
) -> bool

◆ process_signal()

auto ActorModel::Node::process_signal ( const Pid &  pid,
const Signal &  sig 
) -> bool
protected
Here is the call graph for this function:

◆ register_name()

auto ActorModel::Node::register_name ( const string_view  name,
const Pid &  pid 
) -> bool

◆ registered()

auto ActorModel::Node::registered ( ) -> const NamedProcessRegistry

◆ send() [1/2]

auto ActorModel::Node::send ( const Pid &  pid,
const Message &  message 
) -> bool

◆ send() [2/2]

auto ActorModel::Node::send ( const Pid &  pid,
const string_view  type,
const string_view  payload 
) -> bool

◆ send_after() [1/2]

auto ActorModel::Node::send_after ( const Time  time,
const Pid &  pid,
const Message &  message 
) -> TRef
Here is the call graph for this function:

◆ send_after() [2/2]

auto ActorModel::Node::send_after ( const Time  time,
const Pid &  pid,
const string_view  type,
const string_view  payload 
) -> TRef
Here is the call graph for this function:

◆ send_interval() [1/2]

auto ActorModel::Node::send_interval ( const Time  time,
const Pid &  pid,
const Message &  message 
) -> TRef
Here is the call graph for this function:

◆ send_interval() [2/2]

auto ActorModel::Node::send_interval ( const Time  time,
const Pid &  pid,
const string_view  type,
const string_view  payload 
) -> TRef
Here is the call graph for this function:

◆ signal()

auto ActorModel::Node::signal ( const Pid &  pid,
flatbuffers::DetachedBuffer &&  signal_buf 
) -> SignalRef
protected
Here is the call graph for this function:

◆ signal_timer_callback()

auto ActorModel::Node::signal_timer_callback ( const SignalRef  signal_ref) -> bool

◆ spawn()

auto ActorModel::Node::spawn ( const Behaviour &&  _behaviour,
const ExecConfigCallback &&  _exec_config_callback 
) -> Pid

◆ spawn_link()

auto ActorModel::Node::spawn_link ( const Pid &  _initial_link_pid,
const Behaviour &&  _behaviour,
const ExecConfigCallback &&  _exec_config_callback 
) -> Pid

◆ start_timer()

auto ActorModel::Node::start_timer ( const Time  time,
const Pid &  pid,
flatbuffers::DetachedBuffer &&  message_buf,
const bool  is_recurring = false 
) -> TRef
protected
Here is the call graph for this function:

◆ terminate()

auto ActorModel::Node::terminate ( const Pid &  pid) -> bool
protected
Here is the call graph for this function:

◆ timer_callback()

auto ActorModel::Node::timer_callback ( const TRef  tref) -> bool
Here is the call graph for this function:

◆ unregister()

auto ActorModel::Node::unregister ( const string_view  name) -> bool

◆ whereis()

auto ActorModel::Node::whereis ( const string_view  name) -> MaybePid

Friends And Related Function Documentation

◆ Process

friend class Process
friend

Member Data Documentation

◆ function_registry

FunctionRegistry ActorModel::Node::function_registry
protected

◆ module_registry

ModuleRegistry ActorModel::Node::module_registry
protected

◆ named_process_registry

NamedProcessRegistry ActorModel::Node::named_process_registry
protected

◆ next_signal_ref

SignalRef ActorModel::Node::next_signal_ref = 1
protected

◆ next_tref

TRef ActorModel::Node::next_tref = 1
protected

◆ process_registry

ProcessRegistry ActorModel::Node::process_registry
protected

◆ timed_messages

TimedMessages ActorModel::Node::timed_messages
protected

◆ timed_signals

TimedSignals ActorModel::Node::timed_signals
protected

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