17 #include "actor_model_generated.h" 19 #include <experimental/string_view> 35 const Pid& _initial_link_pid,
43 const bool flag_setting
60 const std::vector<uint8_t>& payload_vec
66 const flatbuffers::Vector<uint8_t>& payload_fbvec
92 const std::vector<uint8_t>& payload_vec
119 const std::vector<uint8_t>& payload_vec
177 return (message.type() and message.type()->string_view() == type);
187 if (
matches(message, type) and (message.payload()->size() > 0))
190 reinterpret_cast<const char*>(message.payload()->data()),
191 message.payload()->size()
207 if (
matches(message, type) and (message.payload()->size() > 0))
210 reinterpret_cast<const char*>(message.payload()->data()),
211 message.payload()->size()
227 if (
matches(message, type) and (message.payload()->size() > 0))
230 message.payload()->data(),
231 (message.payload()->data() + message.payload()->size())
240 template<
typename TableT>
245 const TableT*& payload_ptr
248 if (
matches(message, type) and (message.payload()->size() > 0))
250 flatbuffers::Verifier verifier(
251 message.payload()->data(),
252 message.payload()->size()
254 auto verified = verifier.VerifyBuffer<TableT>(
nullptr);
258 auto fb = flatbuffers::GetRoot<TableT>(
259 message.payload()->data()
273 template<
typename TableObjT,
class =
typename TableObjT::TableType>
281 if (
matches(message, type) and (message.payload()->size() > 0))
283 flatbuffers::Verifier verifier(
284 message.payload()->data(),
285 message.payload()->size()
288 verifier.VerifyBuffer<
typename TableObjT::TableType>(
nullptr)
293 auto fb = flatbuffers::GetRoot<typename TableObjT::TableType>(
294 message.payload()->data()
file_extension fb
Definition: firmware_update.fbs:29
auto send(const Pid &pid, const Message &message) -> bool
Definition: actor_model.cpp:58
delegate< void(ProcessExecutionConfigBuilder &)> ExecConfigCallback
Definition: node.h:30
std::experimental::string_view Reason
Definition: process.h:43
auto register_name(const string_view name, const Pid &pid) -> bool
Definition: actor_model.cpp:232
Definition: behaviour.h:30
auto unregister(const string_view name) -> bool
Definition: actor_model.cpp:239
root_type Message
Definition: actor_model.fbs:125
auto spawn(const ActorBehaviour &&_actor_behaviour, const ExecConfigCallback &&_exec_config_callback) -> Pid
Definition: actor.cpp:27
size_t TRef
Definition: node.h:33
std::experimental::optional< Pid > MaybePid
Definition: pid.h:20
auto matches(const ActorModel::Message &message) -> bool
Definition: actor_model.h:164
auto module(const std::experimental::string_view module_flatbuffer) -> bool
Definition: actor_model.cpp:267
auto spawn_link(const Pid &_initial_link_pid, const ActorBehaviour &&_actor_behaviour, const ExecConfigCallback &&_exec_config_callback) -> Pid
Definition: actor.cpp:39
flatbuffers::DetachedBuffer MessageFlatbuffer
Definition: actor_model.h:23
Definition: actor_model.fbs:27
std::string string
Definition: oom_killer_actor_behaviour.cpp:24
std::experimental::string_view string_view
Definition: actor_model.cpp:16
ProcessFlag
Definition: actor_model.fbs:22
auto apply(const Pid &pid, const std::experimental::string_view function_name, const std::experimental::string_view args) -> ResultUnion
Definition: actor_model.cpp:274
auto process_flag(const Pid &pid, const ProcessFlag flag, const bool flag_setting) -> bool
Definition: actor_model.cpp:48
UUID::UUID Pid
Definition: pid.h:19
std::chrono::milliseconds Time
Definition: node.h:31
auto exit(const Pid &pid, const Pid &pid2, const Reason exit_reason) -> bool
Definition: actor_model.cpp:260
delegate< ResultUnion(const Pid &, Mailbox &)> Behaviour
Definition: behaviour.h:80
auto send_interval(const Time time, const Pid &pid, const Message &message) -> TRef
Definition: actor_model.cpp:173
auto send_after(const Time time, const Pid &pid, const Message &message) -> TRef
Definition: actor_model.cpp:121
std::unordered_map< string, Pid > NamedProcessRegistry
Definition: node.h:86
auto registered() -> const Node::NamedProcessRegistry
Definition: actor_model.cpp:246
std::vector< uint8_t > MutableFlatbuffer
Definition: actor_model.h:24
auto cancel(const TRef tref) -> bool
Definition: actor_model.cpp:225
auto whereis(const string_view name) -> MaybePid
Definition: actor_model.cpp:253