C++ Actor Framework 1.0.0
Loading...
Searching...
No Matches
caf::event_based_actor Class Reference

A cooperatively scheduled, event-based actor implementation. More...

#include <event_based_actor.hpp>

Inheritance diagram for caf::event_based_actor:
caf::dynamically_typed_actor_base

Public Types

using signatures = none_t
 Required by spawn for type deduction.
 
using behavior_type = behavior
 Required by spawn for type deduction.
 
using handle_type = actor
 

Public Member Functions

 event_based_actor (actor_config &cfg)
 
void initialize () override
 
template<class... Args>
auto mail (Args &&... args)
 Starts a new message.
 
template<class T , class... Ts>
void become (T &&arg, Ts &&... args)
 Changes the behavior of this actor.
 
void unbecome ()
 Removes the last added behavior.
 

Protected Member Functions

virtual behavior make_behavior ()
 Returns the initial actor behavior.
 

Detailed Description

A cooperatively scheduled, event-based actor implementation.

This is the recommended base class for user-defined actors.

Examples
dancing_kirby.cpp, dining_philosophers.cpp, and hello_world.cpp.

Member Function Documentation

◆ unbecome()

void caf::event_based_actor::unbecome ( )

Removes the last added behavior.

Terminates the actor if there are no behaviors left.


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