libcaf  0.15.3
Public Types | Public Member Functions | Friends | List of all members
caf::actor_registry Class Reference

A registry is used to associate actors to IDs or atoms (names). More...

#include <actor_registry.hpp>

Public Types

using name_map = std::unordered_map< atom_value, strong_actor_ptr >
 

Public Member Functions

strong_actor_ptr get (actor_id key) const
 Returns the the local actor associated to key.
 
void put (actor_id key, strong_actor_ptr val)
 Associates a local actor with its ID.
 
void erase (actor_id key)
 Removes an actor from this registry, leaving reason for future reference. More...
 
void inc_running ()
 Increases running-actors-count by one.
 
void 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). More...
 
strong_actor_ptr get (atom_value key) const
 Returns the actor associated with key or invalid_actor.
 
void put (atom_value key, strong_actor_ptr value)
 Associates given actor to key.
 
void erase (atom_value key)
 Removes a name mapping.
 
name_map named_actors () const
 

Friends

class actor_system
 

Detailed Description

A registry is used to associate actors to IDs or atoms (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.

Member Function Documentation

void caf::actor_registry::await_running_count_equal ( size_t  expected) const

Blocks the caller until running-actors-count becomes expected (must be either 0 or 1).

void caf::actor_registry::erase ( actor_id  key)

Removes an actor from this registry, leaving reason for future reference.


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