C++ Actor Framework 0.19
|
An event-based actor with managed state. More...
#include <stateful_actor.hpp>
Inherits detail::stateful_actor_base_t< State, Base >.
Public Types | |
using | super = detail::stateful_actor_base_t< State, Base > |
Public Member Functions | |
template<class... Ts> | |
stateful_actor (actor_config &cfg, Ts &&... xs) | |
void | on_exit () override |
Can be overridden to perform cleanup code after an actor finished execution. | |
const char * | name () const override |
Public Attributes | ||
union { | ||
State state | ||
The actor's state. More... | ||
}; | ||
An event-based actor with managed state.
The state is constructed with the actor, but destroyed when the actor calls quit
. This state management brakes cycles and allows actors to automatically release resources as soon as possible.
|
override |
Can be overridden to perform cleanup code after an actor finished execution.
super::on_exit()
in order to clean up the state. State caf::stateful_actor< State, Base >::state |
The actor's state.
This member lives inside a union since its lifetime ends when the actor terminates while the actual actor object lives until its reference count drops to zero.