MakerLabs ACM
ActorModel Namespace Reference

Classes

class  Mailbox
 
class  Node
 
struct  OomKillerActorState
 
class  Process
 
class  ReceivedMessage
 
struct  ResultUnion
 
struct  SupervisorActorState
 
struct  TaskMemoryInfo
 
class  TimedBufferDelivery
 

Typedefs

using string_view = std::experimental::string_view
 
using Reason = Process::Reason
 
using MessageFlatbuffer = flatbuffers::DetachedBuffer
 
using MutableFlatbuffer = std::vector< uint8_t >
 
using State = void
 
using StatePtr = std::shared_ptr< State >
 
using ActorBehaviour = delegate< ResultUnion(const Pid &, StatePtr &state, const Message &)>
 
using ActorBehaviours = std::vector< ActorBehaviour >
 
using Behaviour = delegate< ResultUnion(const Pid &, Mailbox &)>
 
using ExecConfigCallback = delegate< void(ProcessExecutionConfigBuilder &)>
 
using Time = std::chrono::milliseconds
 
using TRef = size_t
 
using SignalRef = size_t
 
using TTL = int
 
using ModuleFlatbuffer = std::vector< uint8_t >
 
using FunctionFlatbuffer = flatbuffers::DetachedBuffer
 
using FunctionMutableFlatbuffer = std::vector< uint8_t >
 
using string = std::string
 
using Pid = UUID::UUID
 
using MaybePid = std::experimental::optional< Pid >
 
using MutableSupervisorArgsFlatbuffer = std::vector< uint8_t >
 

Functions

auto _actor_spawn (const ActorBehaviours &&_actor_behaviours, const MaybePid &_initial_link_pid=std::experimental::nullopt, const ExecConfigCallback &&_exec_config_callback=nullptr) -> Pid
 
auto spawn (const ActorBehaviour &&_actor_behaviour, const ExecConfigCallback &&_exec_config_callback) -> Pid
 
auto spawn_link (const Pid &_initial_link_pid, const ActorBehaviour &&_actor_behaviour, const ExecConfigCallback &&_exec_config_callback) -> Pid
 
auto spawn (const ActorBehaviours &&_actor_behaviours, const ExecConfigCallback &&_exec_config_callback) -> Pid
 
auto spawn_link (const Pid &_initial_link_pid, const ActorBehaviours &&_actor_behaviours, const ExecConfigCallback &&_exec_config_callback) -> Pid
 
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 (const Pid &pid, const string_view type, const std::vector< uint8_t > &payload_vec) -> bool
 
auto send (const Pid &pid, const string_view type, const flatbuffers::Vector< uint8_t > &payload_fbvec) -> bool
 
auto send (const Pid &pid, const string_view type, const MessageFlatbuffer &payload_flatbuffer) -> 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_after (const Time time, const Pid &pid, const string_view type, const std::vector< uint8_t > &payload_vec) -> TRef
 
auto send_after (const Time time, const Pid &pid, const string_view type, const MessageFlatbuffer &payload_flatbuffer) -> 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 send_interval (const Time time, const Pid &pid, const string_view type, const std::vector< uint8_t > &payload_vec) -> TRef
 
auto send_interval (const Time time, const Pid &pid, const string_view type, const MessageFlatbuffer &payload_flatbuffer) -> TRef
 
auto cancel (const TRef tref) -> bool
 
auto register_name (const string_view name, const Pid &pid) -> bool
 
auto unregister (const string_view name) -> bool
 
auto registered () -> const Node::NamedProcessRegistry
 
auto whereis (const string_view name) -> MaybePid
 
auto exit (const Pid &pid, const Pid &pid2, const Reason exit_reason) -> bool
 
auto module (const std::experimental::string_view module_flatbuffer) -> bool
 
auto apply (const Pid &pid, const std::experimental::string_view function_name, const std::experimental::string_view args) -> ResultUnion
 
auto apply (const Pid &pid, const std::experimental::string_view module_name, const std::experimental::string_view function_name, const std::experimental::string_view args) -> ResultUnion
 
auto matches (const ActorModel::Message &message) -> bool
 
auto matches (const ActorModel::Message &message, const std::experimental::string_view type) -> bool
 
auto matches (const ActorModel::Message &message, const std::experimental::string_view type, std::experimental::string_view &payload) -> bool
 
auto matches (const ActorModel::Message &message, const std::experimental::string_view type, std::string &payload) -> bool
 
auto matches (const ActorModel::Message &message, const std::experimental::string_view type, MutableFlatbuffer &payload) -> bool
 
template<typename TableT >
auto matches (const ActorModel::Message &message, const std::experimental::string_view type, const TableT *&payload_ptr) -> bool
 
template<typename TableObjT , class = typename TableObjT::TableType>
auto matches (const ActorModel::Message &message, const std::experimental::string_view type, TableObjT &obj) -> bool
 
auto _timer_callback (TimerHandle_t timer_handle) -> void
 
auto _signal_timer_callback (TimerHandle_t timer_handle) -> void
 
auto oom_killer_actor_behaviour (const Pid &self, StatePtr &_state, const Message &message) -> ResultUnion
 
auto oom_killer_actor_behaviour (const ActorModel::Pid &self, ActorModel::StatePtr &state, const ActorModel::Message &message) -> ActorModel::ResultUnion
 
void process_task (void *user_data=nullptr)
 
auto supervisor_actor_behaviour (const Pid &self, StatePtr &_state, const Message &message) -> ResultUnion
 
auto supervisor_actor_behaviour (const ActorModel::Pid &self, ActorModel::StatePtr &state, const ActorModel::Message &message) -> ActorModel::ResultUnion
 

Variables

constexpr TRef NullTRef = 0
 
constexpr SignalRef NullSignalRef = 0
 
constexpr char TAG [] = "oom_killer"
 
static Pid & NullPid = UUID::NullUUID
 
static Node default_node
 
static ResultUnion Ok
 
static ResultUnion Done
 
static ResultUnion Unhandled
 

Typedef Documentation

◆ ActorBehaviour

using ActorModel::ActorBehaviour = typedef delegate<ResultUnion( const Pid&, StatePtr& state, const Message& )>

◆ ActorBehaviours

using ActorModel::ActorBehaviours = typedef std::vector<ActorBehaviour>

◆ Behaviour

using ActorModel::Behaviour = typedef delegate<ResultUnion( const Pid&, Mailbox& )>

◆ ExecConfigCallback

using ActorModel::ExecConfigCallback = typedef delegate<void(ProcessExecutionConfigBuilder&)>

◆ FunctionFlatbuffer

using ActorModel::FunctionFlatbuffer = typedef flatbuffers::DetachedBuffer

◆ FunctionMutableFlatbuffer

using ActorModel::FunctionMutableFlatbuffer = typedef std::vector<uint8_t>

◆ MaybePid

using ActorModel::MaybePid = typedef std::experimental::optional<Pid>

◆ MessageFlatbuffer

using ActorModel::MessageFlatbuffer = typedef flatbuffers::DetachedBuffer

◆ ModuleFlatbuffer

using ActorModel::ModuleFlatbuffer = typedef std::vector<uint8_t>

◆ MutableFlatbuffer

using ActorModel::MutableFlatbuffer = typedef std::vector<uint8_t>

◆ MutableSupervisorArgsFlatbuffer

using ActorModel::MutableSupervisorArgsFlatbuffer = typedef std::vector<uint8_t>

◆ Pid

using ActorModel::Pid = typedef UUID::UUID

◆ Reason

◆ SignalRef

using ActorModel::SignalRef = typedef size_t

◆ State

using ActorModel::State = typedef void

◆ StatePtr

using ActorModel::StatePtr = typedef std::shared_ptr<State>

◆ string

typedef std::string ActorModel::string

◆ string_view

typedef std::experimental::string_view ActorModel::string_view

◆ Time

using ActorModel::Time = typedef std::chrono::milliseconds

◆ TRef

using ActorModel::TRef = typedef size_t

◆ TTL

using ActorModel::TTL = typedef int

Function Documentation

◆ _actor_spawn()

auto ActorModel::_actor_spawn ( const ActorBehaviours &&  _actor_behaviours,
const MaybePid &  _initial_link_pid = std::experimental::nullopt,
const ExecConfigCallback &&  _exec_config_callback = nullptr 
) -> Pid
Here is the call graph for this function:

◆ _signal_timer_callback()

auto ActorModel::_signal_timer_callback ( TimerHandle_t  timer_handle) -> void
Here is the call graph for this function:

◆ _timer_callback()

auto ActorModel::_timer_callback ( TimerHandle_t  timer_handle) -> void
Here is the call graph for this function:

◆ apply() [1/2]

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

◆ apply() [2/2]

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

◆ cancel()

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

◆ exit()

auto ActorModel::exit ( const Pid &  pid,
const Pid &  pid2,
const Reason  exit_reason 
) -> bool
Here is the call graph for this function:

◆ matches() [1/7]

auto ActorModel::matches ( const ActorModel::Message &  message) -> bool
inline

◆ matches() [2/7]

auto ActorModel::matches ( const ActorModel::Message &  message,
const std::experimental::string_view  type 
) -> bool
inline

◆ matches() [3/7]

auto ActorModel::matches ( const ActorModel::Message &  message,
const std::experimental::string_view  type,
std::experimental::string_view &  payload 
) -> bool
inline
Here is the call graph for this function:

◆ matches() [4/7]

auto ActorModel::matches ( const ActorModel::Message &  message,
const std::experimental::string_view  type,
std::string &  payload 
) -> bool
inline
Here is the call graph for this function:

◆ matches() [5/7]

auto ActorModel::matches ( const ActorModel::Message &  message,
const std::experimental::string_view  type,
MutableFlatbuffer &  payload 
) -> bool
inline
Here is the call graph for this function:

◆ matches() [6/7]

template<typename TableT >
auto ActorModel::matches ( const ActorModel::Message &  message,
const std::experimental::string_view  type,
const TableT *&  payload_ptr 
) -> bool
inline
Here is the call graph for this function:

◆ matches() [7/7]

template<typename TableObjT , class = typename TableObjT::TableType>
auto ActorModel::matches ( const ActorModel::Message &  message,
const std::experimental::string_view  type,
TableObjT &  obj 
) -> bool
inline
Here is the call graph for this function:

◆ module()

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

◆ oom_killer_actor_behaviour() [1/2]

auto ActorModel::oom_killer_actor_behaviour ( const ActorModel::Pid &  self,
ActorModel::StatePtr &  state,
const ActorModel::Message &  message 
) -> ActorModel::ResultUnion

◆ oom_killer_actor_behaviour() [2/2]

auto ActorModel::oom_killer_actor_behaviour ( const Pid &  self,
StatePtr &  _state,
const Message &  message 
) -> ResultUnion
Here is the call graph for this function:

◆ process_flag()

auto ActorModel::process_flag ( const Pid &  pid,
const ProcessFlag  flag,
const bool  flag_setting 
) -> bool
Here is the call graph for this function:

◆ process_task()

auto ActorModel::process_task ( void *  user_data = nullptr)

◆ register_name()

auto ActorModel::register_name ( const string_view  name,
const Pid &  pid 
) -> bool
Here is the call graph for this function:

◆ registered()

auto ActorModel::registered ( ) -> const Node::NamedProcessRegistry
Here is the call graph for this function:

◆ send() [1/5]

auto ActorModel::send ( const Pid &  pid,
const Message &  message 
) -> bool
Here is the call graph for this function:

◆ send() [2/5]

auto ActorModel::send ( const Pid &  pid,
const string_view  type,
const string_view  payload 
) -> bool
Here is the call graph for this function:

◆ send() [3/5]

auto ActorModel::send ( const Pid &  pid,
const string_view  type,
const std::vector< uint8_t > &  payload_vec 
) -> bool
Here is the call graph for this function:

◆ send() [4/5]

auto ActorModel::send ( const Pid &  pid,
const string_view  type,
const flatbuffers::Vector< uint8_t > &  payload_fbvec 
) -> bool
Here is the call graph for this function:

◆ send() [5/5]

auto ActorModel::send ( const Pid &  pid,
const string_view  type,
const MessageFlatbuffer &  payload_flatbuffer 
) -> bool
Here is the call graph for this function:

◆ send_after() [1/4]

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

◆ send_after() [2/4]

auto ActorModel::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_after() [3/4]

auto ActorModel::send_after ( const Time  time,
const Pid &  pid,
const string_view  type,
const std::vector< uint8_t > &  payload_vec 
) -> TRef
Here is the call graph for this function:

◆ send_after() [4/4]

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

◆ send_interval() [1/4]

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

◆ send_interval() [2/4]

auto ActorModel::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:

◆ send_interval() [3/4]

auto ActorModel::send_interval ( const Time  time,
const Pid &  pid,
const string_view  type,
const std::vector< uint8_t > &  payload_vec 
) -> TRef
Here is the call graph for this function:

◆ send_interval() [4/4]

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

◆ spawn() [1/3]

auto ActorModel::spawn ( const Behaviour &&  _behaviour,
const ExecConfigCallback &&  _exec_config_callback 
) -> Pid
Here is the call graph for this function:

◆ spawn() [2/3]

auto ActorModel::spawn ( const ActorBehaviour &&  _actor_behaviour,
const ExecConfigCallback &&  _exec_config_callback 
) -> Pid
Here is the call graph for this function:

◆ spawn() [3/3]

auto ActorModel::spawn ( const ActorBehaviours &&  _actor_behaviours,
const ExecConfigCallback &&  _exec_config_callback 
) -> Pid
Here is the call graph for this function:

◆ spawn_link() [1/3]

auto ActorModel::spawn_link ( const Pid &  _initial_link_pid,
const Behaviour &&  _behaviour,
const ExecConfigCallback &&  _exec_config_callback 
) -> Pid
Here is the call graph for this function:

◆ spawn_link() [2/3]

auto ActorModel::spawn_link ( const Pid &  _initial_link_pid,
const ActorBehaviour &&  _actor_behaviour,
const ExecConfigCallback &&  _exec_config_callback 
) -> Pid
Here is the call graph for this function:

◆ spawn_link() [3/3]

auto ActorModel::spawn_link ( const Pid &  _initial_link_pid,
const ActorBehaviours &&  _actor_behaviours,
const ExecConfigCallback &&  _exec_config_callback 
) -> Pid
Here is the call graph for this function:

◆ supervisor_actor_behaviour() [1/2]

auto ActorModel::supervisor_actor_behaviour ( const ActorModel::Pid &  self,
ActorModel::StatePtr &  state,
const ActorModel::Message &  message 
) -> ActorModel::ResultUnion

◆ supervisor_actor_behaviour() [2/2]

auto ActorModel::supervisor_actor_behaviour ( const Pid &  self,
StatePtr &  _state,
const Message &  message 
) -> ResultUnion
Here is the call graph for this function:

◆ unregister()

auto ActorModel::unregister ( const string_view  name) -> bool
Here is the call graph for this function:

◆ whereis()

auto ActorModel::whereis ( const string_view  name) -> MaybePid
Here is the call graph for this function:

Variable Documentation

◆ default_node

Node ActorModel::default_node
static

◆ Done

ResultUnion ActorModel::Done
static

◆ NullPid

Pid& ActorModel::NullPid = UUID::NullUUID
static

◆ NullSignalRef

constexpr SignalRef ActorModel::NullSignalRef = 0

◆ NullTRef

constexpr TRef ActorModel::NullTRef = 0

◆ Ok

ResultUnion ActorModel::Ok
static

◆ TAG

constexpr char ActorModel::TAG = "oom_killer"

◆ Unhandled

ResultUnion ActorModel::Unhandled
static