libcppa
Version 0.1
|
#include <actor.hpp>
Public Member Functions | |
virtual bool | attach (attachable *ptr)=0 |
template<typename F > | |
bool | attach_functor (F &&ftor) |
virtual void | detach (const attachable::token &what)=0 |
void | join (group_ptr &what) |
void | leave (const group_ptr &what) |
virtual void | link_to (intrusive_ptr< actor > &other)=0 |
virtual void | unlink_from (intrusive_ptr< actor > &other)=0 |
virtual bool | establish_backlink (intrusive_ptr< actor > &other)=0 |
virtual bool | remove_backlink (intrusive_ptr< actor > &other)=0 |
void | link_to (intrusive_ptr< actor > &&other) |
void | unlink_from (intrusive_ptr< actor > &&other) |
bool | remove_backlink (intrusive_ptr< actor > &&to) |
bool | establish_backlink (intrusive_ptr< actor > &&to) |
const process_information & | parent_process () const |
process_information_ptr | parent_process_ptr () const |
std::uint32_t | id () const |
Static Public Member Functions | |
static intrusive_ptr< actor > | by_id (std::uint32_t actor_id) |
Base class for all actor implementations.
virtual bool cppa::actor::attach | ( | attachable * | ptr | ) | [pure virtual] |
Attaches ptr
to this actor (the actor takes ownership of ptr
).
The actor will call ptr->detach(...)
on exit or immediately if he already exited.
true
if ptr
was successfully attached to the actor; otherwise (actor already exited) false
. bool cppa::actor::attach_functor | ( | F && | ftor | ) |
Attaches the functor or function ftor
to this actor.
The actor executes ftor()
on exit or immediatley if he already exited.
true
if ftor
was successfully attached to the actor; otherwise (actor already exited) false
. static intrusive_ptr<actor> cppa::actor::by_id | ( | std::uint32_t | actor_id | ) | [static] |
Get the actor that has the unique identifier actor_id
.
nullptr
if no running actor with the ID actor_id
was found in this process. virtual void cppa::actor::detach | ( | const attachable::token & | what | ) | [pure virtual] |
Detaches the first attached object that matches what
.
virtual bool cppa::actor::establish_backlink | ( | intrusive_ptr< actor > & | other | ) | [pure virtual] |
Establishes a link relation between this actor and other
.
other | Actor instance that wants to link against this Actor. |
true
if this actor is running and added other
to its list of linked actors; otherwise false
. Implemented in cppa::actor_proxy.
bool cppa::actor::establish_backlink | ( | intrusive_ptr< actor > && | to | ) |
Establishes a link relation between this actor and other
.
other | Actor instance that wants to link against this Actor. |
true
if this actor is running and added other
to its list of linked actors; otherwise false
. std::uint32_t cppa::actor::id | ( | ) | const |
Gets an integer value that uniquely identifies this Actor in the process it's executed in.
void cppa::actor::join | ( | group_ptr & | what | ) |
Forces this actor to subscribe to the group what
.
The group will be unsubscribed if the actor finishes execution.
what | Group instance that should be joined. |
void cppa::actor::leave | ( | const group_ptr & | what | ) |
Forces this actor to leave the group what
.
what | Joined group that should be leaved. |
virtual void cppa::actor::link_to | ( | intrusive_ptr< actor > & | other | ) | [pure virtual] |
Links this actor to other
.
other | Actor instance that whose execution is coupled to the execution of this Actor. |
Implemented in cppa::actor_proxy.
void cppa::actor::link_to | ( | intrusive_ptr< actor > && | other | ) |
Links this actor to other
.
other | Actor instance that whose execution is coupled to the execution of this Actor. |
const process_information & cppa::actor::parent_process | ( | ) | const |
Gets the process_information of the parent process.
process_information_ptr cppa::actor::parent_process_ptr | ( | ) | const |
Gets the process_information pointer of the parent process.
virtual bool cppa::actor::remove_backlink | ( | intrusive_ptr< actor > & | other | ) | [pure virtual] |
Removes a link relation between this actor and other
.
other | Actor instance that wants to unlink from this Actor. |
true
if this actor is running and removed other
from its list of linked actors; otherwise false
. Implemented in cppa::actor_proxy.
bool cppa::actor::remove_backlink | ( | intrusive_ptr< actor > && | to | ) |
Removes a link relation between this actor and other
.
other | Actor instance that wants to unlink from this Actor. |
true
if this actor is running and removed other
from its list of linked actors; otherwise false
. virtual void cppa::actor::unlink_from | ( | intrusive_ptr< actor > & | other | ) | [pure virtual] |
Unlinks this actor from other
.
oter | Linked Actor. |
Implemented in cppa::actor_proxy.
void cppa::actor::unlink_from | ( | intrusive_ptr< actor > && | other | ) |
Unlinks this actor from other
.
oter | Linked Actor. |