CAF  0.17.3
Public Member Functions | Public Attributes | List of all members
caf::stateful_actor< State, Base > Class Template Reference

An event-based actor with managed state. More...

#include <stateful_actor.hpp>

Inheritance diagram for caf::stateful_actor< State, Base >:
caf::composable_behavior_based_actor< State, Base >

Public Member Functions

template<class... Ts>
 stateful_actor (actor_config &cfg, Ts &&... xs)
void on_exit () final
 Destroys the state of this actor (no further overriding allowed).
const char * name () const final

Public Attributes

State & state
 A reference to the actor's state.
State state_

Detailed Description

template<class State, class Base>
class caf::stateful_actor< State, Base >

An event-based actor with managed state.

The state is constructed before make_behavior will get called and destroyed after the actor called quit. This state management brakes cycles and allows actors to automatically release resources as soon as possible.

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