C++ Actor Framework 0.19
|
A registry is used to associate actors to IDs or names. More...
#include <actor_registry.hpp>
Public Types | |
using | name_map = std::unordered_map< std::string, strong_actor_ptr > |
Public Member Functions | |
template<class T = strong_actor_ptr> | |
T | get (actor_id key) const |
Returns the local actor associated to key . | |
template<class T > | |
void | put (actor_id key, const T &val) |
Associates a local actor with its ID. | |
void | erase (actor_id key) |
Removes an actor from this registry, leaving reason for future reference. | |
size_t | inc_running () |
Increases running-actors-count by one. | |
size_t | dec_running () |
Decreases running-actors-count by one. | |
size_t | running () const |
Returns the number of currently running actors. | |
void | await_running_count_equal (size_t expected) const |
Blocks the caller until running-actors-count becomes expected (must be either 0 or 1). | |
template<class T = strong_actor_ptr> | |
T | get (const std::string &key) const |
Returns the actor associated with key or invalid_actor . | |
template<class T > | |
void | put (const std::string &key, const T &value) |
Associates given actor to key . | |
void | erase (const std::string &key) |
Removes a name mapping. | |
name_map | named_actors () const |
Friends | |
class | actor_system |
A registry is used to associate actors to IDs or names.
This allows a middleman to lookup actor handles after receiving actor IDs via the network and enables developers to use well-known names to identify important actors independent from their ID at runtime. Note that the registry does not contain all actors of an actor system. The middleman registers actors as needed.
size_t caf::actor_registry::dec_running | ( | ) |
Decreases running-actors-count by one.
size_t caf::actor_registry::inc_running | ( | ) |
Increases running-actors-count by one.