libcppa  Version 0.1
Public Member Functions | Static Public Member Functions
cppa::actor Class Reference

#include <actor.hpp>

Inheritance diagram for cppa::actor:
cppa::channel cppa::ref_counted cppa::detail::abstract_actor< actor > cppa::local_actor cppa::actor_proxy cppa::detail::abstract_actor< local_actor > cppa::detail::converted_thread_context cppa::detail::scheduled_actor

List of all members.

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_informationparent_process () const
process_information_ptr parent_process_ptr () const
std::uint32_t id () const

Static Public Member Functions

static intrusive_ptr< actorby_id (std::uint32_t actor_id)

Detailed Description

Base class for all actor implementations.


Member Function Documentation

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.

Returns:
true if ptr was successfully attached to the actor; otherwise (actor already exited) false.
template<typename F >
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.

Returns:
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.

Returns:
A pointer to the requestet actor or 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.

Parameters:
otherActor instance that wants to link against this Actor.
Returns:
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.

Parameters:
otherActor instance that wants to link against this Actor.
Returns:
true if this actor is running and added other to its list of linked actors; otherwise false.
Support for rvalue references.

std::uint32_t cppa::actor::id ( ) const

Gets an integer value that uniquely identifies this Actor in the process it's executed in.

Returns:
The unique identifier of this actor.
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.

Parameters:
whatGroup instance that should be joined.
void cppa::actor::leave ( const group_ptr what)

Forces this actor to leave the group what.

Parameters:
whatJoined group that should be leaved.
Note:
Groups are leaved automatically if the Actor finishes execution.
virtual void cppa::actor::link_to ( intrusive_ptr< actor > &  other) [pure virtual]

Links this actor to other.

Parameters:
otherActor 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.

Parameters:
otherActor instance that whose execution is coupled to the execution of this Actor.
Support for rvalue references.

const process_information & cppa::actor::parent_process ( ) const

Gets the process_information of the parent process.

Returns:
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.

Returns:
A pointer to the process_information 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.

Parameters:
otherActor instance that wants to unlink from this Actor.
Returns:
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.

Parameters:
otherActor instance that wants to unlink from this Actor.
Returns:
true if this actor is running and removed other from its list of linked actors; otherwise false.
Support for rvalue references.

virtual void cppa::actor::unlink_from ( intrusive_ptr< actor > &  other) [pure virtual]

Unlinks this actor from other.

Parameters:
oterLinked Actor.
Note:
Links are automatically removed if the Actor finishes execution.

Implemented in cppa::actor_proxy.

void cppa::actor::unlink_from ( intrusive_ptr< actor > &&  other)

Unlinks this actor from other.

Parameters:
oterLinked Actor.
Note:
Links are automatically removed if the Actor finishes execution.
Support for rvalue references.


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