C++ Actor Framework 0.19
|
Describes the behavior of an actor, i.e., provides a message handler and an optional timeout. More...
#include <behavior.hpp>
Public Member Functions | |
behavior (behavior &&)=default | |
behavior (const behavior &)=default | |
behavior & | operator= (behavior &&)=default |
behavior & | operator= (const behavior &)=default |
behavior (unsafe_behavior_init_t, behavior from) | |
behavior (const message_handler &mh) | |
Creates a behavior from fun without timeout. | |
template<class T , class... Ts> | |
behavior (T x, Ts &&... xs) | |
The list of arguments can contain match expressions, message handlers, and up to one timeout (if set, the timeout has to be the last argument). | |
template<class F > | |
behavior (timeout_definition< F > tdef) | |
Creates a behavior from tdef without message handler. | |
template<class... Ts> | |
void | assign (Ts &&... xs) |
Assigns new handlers. | |
void | swap (behavior &other) |
void | assign (intrusive_ptr< detail::behavior_impl > ptr) |
void | assign (message_handler other) |
Equal to *this = other . | |
void | assign (behavior other) |
Equal to *this = other . | |
void | handle_timeout () |
Invokes the timeout callback if set. | |
timespan | timeout () const noexcept |
Returns the timespan after which receive operations using this behavior should time out. | |
std::optional< message > | operator() (message &xs) |
Runs this handler and returns its (optional) result. | |
bool | operator() (detail::invoke_result_visitor &f, message &xs) |
Runs this handler with callback. | |
operator bool () const | |
Checks whether this behavior is not empty. | |
Friends | |
class | message_handler |
Describes the behavior of an actor, i.e., provides a message handler and an optional timeout.