libcaf  0.15.3
Classes | Public Types | Public Member Functions | List of all members
caf::proxy_registry Class Reference

Groups a (distributed) set of actors and allows actors in the same namespace to exchange messages. More...

#include <proxy_registry.hpp>

Classes

class  backend
 Responsible for creating proxy actors. More...
 

Public Types

using key_type = node_id
 
using proxy_map = std::map< actor_id, strong_actor_ptr >
 A map that stores all proxies for known remote actors.
 

Public Member Functions

 proxy_registry (actor_system &sys, backend &be)
 
 proxy_registry (const proxy_registry &)=delete
 
proxy_registryoperator= (const proxy_registry &)=delete
 
void serialize (serializer &sink, const actor_addr &addr) const
 
void serialize (deserializer &source, actor_addr &addr)
 
void write (serializer *sink, const actor_addr &ptr) const
 Writes an actor address to sink and adds the actor to the list of known actors for a later deserialization. More...
 
actor_addr read (deserializer *source)
 Reads an actor address from source, creating addresses for remote actors on the fly if needed. More...
 
size_t count_proxies (const key_type &node)
 Returns the number of proxies for node.
 
strong_actor_ptr get (const key_type &node, actor_id aid)
 Returns the proxy instance identified by node and aid.
 
strong_actor_ptr get_or_put (const key_type &nid, actor_id aid)
 Returns the proxy instance identified by node and aid or creates a new (default) proxy instance. More...
 
std::vector< strong_actor_ptrget_all (const key_type &node)
 Returns all known proxies.
 
void erase (const key_type &nid)
 Deletes all proxies for node.
 
void erase (const key_type &inf, actor_id aid, error rsn=exit_reason::remote_link_unreachable)
 Deletes the proxy with id aid for node.
 
bool empty () const
 Queries whether there are any proxies left.
 
void clear ()
 Deletes all proxies.
 
actor_systemsystem ()
 

Detailed Description

Groups a (distributed) set of actors and allows actors in the same namespace to exchange messages.

Member Function Documentation

strong_actor_ptr caf::proxy_registry::get_or_put ( const key_type nid,
actor_id  aid 
)

Returns the proxy instance identified by node and aid or creates a new (default) proxy instance.

actor_addr caf::proxy_registry::read ( deserializer source)

Reads an actor address from source, creating addresses for remote actors on the fly if needed.

void caf::proxy_registry::write ( serializer sink,
const actor_addr ptr 
) const

Writes an actor address to sink and adds the actor to the list of known actors for a later deserialization.


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