libcaf
0.13.2
|
Groups a (distributed) set of actors and allows actors in the same namespace to exchange messages. More...
#include <actor_namespace.hpp>
Classes | |
class | backend |
The backend of an actor namespace is responsible for creating proxy actors. More... | |
Public Types | |
using | key_type = node_id |
using | proxy_map = std::map< actor_id, actor_proxy::anchor_ptr > |
A map that stores all proxies for known remote actors. | |
Public Member Functions | |
actor_namespace (backend &mgm) | |
void | write (serializer *sink, const actor_addr &ptr) |
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 . | |
std::vector< actor_proxy_ptr > | get_all () |
Returns all proxies for node . | |
std::vector< actor_proxy_ptr > | get_all (const key_type &node) |
Returns all proxies for node . | |
actor_proxy_ptr | get (const key_type &node, actor_id aid) |
Returns the proxy instance identified by node and aid or nullptr if the actor either unknown or expired. More... | |
actor_proxy_ptr | get_or_put (const key_type &node, actor_id aid) |
Returns the proxy instance identified by node and aid or creates a new (default) proxy instance. More... | |
void | erase (const key_type &node) |
Deletes all proxies for node . | |
void | erase (const key_type &node, actor_id aid) |
Deletes the proxy with id aid for node . | |
bool | empty () const |
Queries whether there are any proxies left. | |
void | clear () |
Deletes all proxies. | |
Groups a (distributed) set of actors and allows actors in the same namespace to exchange messages.
actor_proxy_ptr caf::actor_namespace::get | ( | const key_type & | node, |
actor_id | aid | ||
) |
Returns the proxy instance identified by node
and aid
or nullptr
if the actor either unknown or expired.
actor_proxy_ptr caf::actor_namespace::get_or_put | ( | const key_type & | node, |
actor_id | aid | ||
) |
Returns the proxy instance identified by node
and aid
or creates a new (default) proxy instance.
actor_addr caf::actor_namespace::read | ( | deserializer * | source | ) |
Reads an actor address from source,
creating addresses for remote actors on the fly if needed.
void caf::actor_namespace::write | ( | serializer * | sink, |
const actor_addr & | ptr | ||
) |
Writes an actor address to sink
and adds the actor to the list of known actors for a later deserialization.