C++ Actor Framework 1.0.0
Loading...
Searching...
No Matches
caf::typed_actor_view< TraitOrSignature > Class Template Reference

Decorates a pointer to a scheduled_actor with a statically typed actor interface. More...

#include <typed_actor_view.hpp>

Inherits extend::template with< mixin::requester >.

Public Types

using trait = detail::to_statically_typed_trait_t<TraitOrSignature>
 
using signatures = typename trait::signatures
 Stores the template parameter pack.
 
using pointer = scheduled_actor*
 

Public Member Functions

 typed_actor_view (scheduled_actor *ptr)
 
template<class T , spawn_options Os = no_spawn_options, class... Ts>
infer_handle_from_class_t< T > spawn (Ts &&... xs)
 
template<spawn_options Os = no_spawn_options, class F , class... Ts>
infer_handle_from_fun_t< F > spawn (F fun, Ts &&... xs)
 
void quit (error x=error{})
 
auto address () const noexcept
 Returns the logical actor address.
 
auto id () const noexcept
 Returns the ID of this actor.
 
auto node () const noexcept
 Returns the node this actor is living on.
 
auto & home_system () const noexcept
 Returns the system that created this actor (or proxy).
 
auto context () const noexcept
 Returns the execution unit currently used by this actor.
 
auto & system () const noexcept
 Returns the hosting actor system.
 
const auto & config () const noexcept
 Returns the config of the hosting actor system.
 
auto & clock () const noexcept
 Returns the clock of the actor system.
 
auto & current_sender () noexcept
 Returns a pointer to the sender of the current message.
 
auto current_message_id () noexcept
 Returns the ID of the current message.
 
auto * current_mailbox_element ()
 Returns a pointer to the currently processed mailbox element.
 
const auto & fail_state () const
 Returns the currently defined fail state.
 
auto & mailbox () noexcept
 
template<class Fun >
void set_default_handler (Fun &&fun)
 
template<class Fun >
void set_error_handler (Fun &&fun)
 
template<class Fun >
void set_down_handler (Fun &&fun)
 
template<class Fun >
void set_node_down_handler (Fun &&fun)
 
template<class Fun >
void set_exit_handler (Fun &&fun)
 
template<class ActorHandle >
void link_to (const ActorHandle &x)
 Links this actor to other.
 
template<class ActorHandle >
void unlink_from (const ActorHandle &x)
 Unlinks this actor from addr.
 
void monitor (const node_id &node)
 Adds a unidirectional monitor to node.
 
template<message_priority P = message_priority::normal, class Handle >
void monitor (const Handle &whom)
 Adds a unidirectional monitor to node.
 
void demonitor (const node_id &node)
 Removes a monitor from node.
 
template<class Handle >
void demonitor (const Handle &whom)
 Removes a monitor from node.
 
template<class... Args>
auto mail (Args &&... args)
 Starts a new message.
 
template<class ActorHandle >
void send_exit (const ActorHandle &whom, error reason)
 Sends an exit message to receiver.
 
template<class Clock , class Duration , class F >
disposable run_scheduled (std::chrono::time_point< Clock, Duration > when, F what)
 
template<class Clock , class Duration , class F >
disposable run_scheduled_weak (std::chrono::time_point< Clock, Duration > when, F what)
 
template<class Rep , class Period , class F >
disposable run_delayed (std::chrono::duration< Rep, Period > delay, F what)
 
template<class Rep , class Period , class F >
disposable run_delayed_weak (std::chrono::duration< Rep, Period > delay, F what)
 
template<class... Args>
void println (std::string_view fmt, Args &&... args)
 Adds a new line to stdout.
 
template<class... Args>
void println (term color, std::string_view fmt, Args &&... args)
 Adds a new line to stdout.
 
void quit (exit_reason reason=exit_reason::normal)
 
template<class... Ts>
detail::make_response_promise_helper_t< Ts... > make_response_promise ()
 
message_id new_request_id (message_priority mp)
 
disposable request_response_timeout (timespan d, message_id mid)
 
response_promise make_response_promise ()
 
void add_awaited_response_handler (message_id response_id, behavior bhvr, disposable pending_timeout={})
 
void add_multiplexed_response_handler (message_id response_id, behavior bhvr, disposable pending_timeout={})
 
template<class Handle , class... Ts>
auto delegate (const Handle &dest, Ts &&... xs)
 
 operator scheduled_actor * () const noexcept
 
template<class T = none_t>
auto make_observable ()
 Returns a factory object for new observable objects on this coordinator.
 
template<class T >
auto observe (typed_stream< T > what, size_t buf_capacity, size_t demand_threshold)
 
template<class T >
auto observe_as (stream what, size_t buf_capacity, size_t demand_threshold)
 
void deregister_stream (uint64_t stream_id)
 

Detailed Description

template<class TraitOrSignature>
class caf::typed_actor_view< TraitOrSignature >

Decorates a pointer to a scheduled_actor with a statically typed actor interface.

Member Function Documentation

◆ address()

template<class TraitOrSignature >
auto caf::typed_actor_view< TraitOrSignature >::address ( ) const
noexcept

Returns the logical actor address.

◆ clock()

template<class TraitOrSignature >
auto & caf::typed_actor_view< TraitOrSignature >::clock ( ) const
noexcept

Returns the clock of the actor system.

◆ config()

template<class TraitOrSignature >
const auto & caf::typed_actor_view< TraitOrSignature >::config ( ) const
noexcept

Returns the config of the hosting actor system.

◆ context()

template<class TraitOrSignature >
auto caf::typed_actor_view< TraitOrSignature >::context ( ) const
noexcept

Returns the execution unit currently used by this actor.

◆ current_mailbox_element()

template<class TraitOrSignature >
auto * caf::typed_actor_view< TraitOrSignature >::current_mailbox_element ( )

Returns a pointer to the currently processed mailbox element.

◆ current_message_id()

template<class TraitOrSignature >
auto caf::typed_actor_view< TraitOrSignature >::current_message_id ( )
noexcept

Returns the ID of the current message.

◆ current_sender()

template<class TraitOrSignature >
auto & caf::typed_actor_view< TraitOrSignature >::current_sender ( )
noexcept

Returns a pointer to the sender of the current message.

Precondition
current_mailbox_element() != nullptr

◆ demonitor() [1/2]

template<class TraitOrSignature >
template<class Handle >
void caf::typed_actor_view< TraitOrSignature >::demonitor ( const Handle & whom)

Removes a monitor from node.

◆ demonitor() [2/2]

template<class TraitOrSignature >
void caf::typed_actor_view< TraitOrSignature >::demonitor ( const node_id & node)

Removes a monitor from node.

◆ deregister_stream()

template<class TraitOrSignature >
void caf::typed_actor_view< TraitOrSignature >::deregister_stream ( uint64_t stream_id)

◆ fail_state()

template<class TraitOrSignature >
const auto & caf::typed_actor_view< TraitOrSignature >::fail_state ( ) const

Returns the currently defined fail state.

If this reason is not none then the actor will terminate with this error after executing the current message handler.

◆ home_system()

template<class TraitOrSignature >
auto & caf::typed_actor_view< TraitOrSignature >::home_system ( ) const
noexcept

Returns the system that created this actor (or proxy).

◆ id()

template<class TraitOrSignature >
auto caf::typed_actor_view< TraitOrSignature >::id ( ) const
noexcept

Returns the ID of this actor.

◆ link_to()

template<class TraitOrSignature >
template<class ActorHandle >
void caf::typed_actor_view< TraitOrSignature >::link_to ( const ActorHandle & x)

Links this actor to other.

◆ mailbox()

template<class TraitOrSignature >
auto & caf::typed_actor_view< TraitOrSignature >::mailbox ( )
noexcept

◆ make_observable()

template<class TraitOrSignature >
template<class T = none_t>
auto caf::typed_actor_view< TraitOrSignature >::make_observable ( )

Returns a factory object for new observable objects on this coordinator.

◆ monitor() [1/2]

template<class TraitOrSignature >
template<message_priority P = message_priority::normal, class Handle >
void caf::typed_actor_view< TraitOrSignature >::monitor ( const Handle & whom)

Adds a unidirectional monitor to node.

Note
Each call to monitor creates a new, independent monitor.

◆ monitor() [2/2]

template<class TraitOrSignature >
void caf::typed_actor_view< TraitOrSignature >::monitor ( const node_id & node)

Adds a unidirectional monitor to node.

Note
Each call to monitor creates a new, independent monitor.

◆ node()

template<class TraitOrSignature >
auto caf::typed_actor_view< TraitOrSignature >::node ( ) const
noexcept

Returns the node this actor is living on.

◆ observe()

template<class TraitOrSignature >
template<class T >
auto caf::typed_actor_view< TraitOrSignature >::observe ( typed_stream< T > what,
size_t buf_capacity,
size_t demand_threshold )

◆ observe_as()

template<class TraitOrSignature >
template<class T >
auto caf::typed_actor_view< TraitOrSignature >::observe_as ( stream what,
size_t buf_capacity,
size_t demand_threshold )

◆ quit()

template<class TraitOrSignature >
void caf::typed_actor_view< TraitOrSignature >::quit ( error x = error{})

◆ run_delayed()

template<class TraitOrSignature >
template<class Rep , class Period , class F >
disposable caf::typed_actor_view< TraitOrSignature >::run_delayed ( std::chrono::duration< Rep, Period > delay,
F what )

◆ run_delayed_weak()

template<class TraitOrSignature >
template<class Rep , class Period , class F >
disposable caf::typed_actor_view< TraitOrSignature >::run_delayed_weak ( std::chrono::duration< Rep, Period > delay,
F what )

◆ run_scheduled()

template<class TraitOrSignature >
template<class Clock , class Duration , class F >
disposable caf::typed_actor_view< TraitOrSignature >::run_scheduled ( std::chrono::time_point< Clock, Duration > when,
F what )

◆ run_scheduled_weak()

template<class TraitOrSignature >
template<class Clock , class Duration , class F >
disposable caf::typed_actor_view< TraitOrSignature >::run_scheduled_weak ( std::chrono::time_point< Clock, Duration > when,
F what )

◆ send_exit()

template<class TraitOrSignature >
template<class ActorHandle >
void caf::typed_actor_view< TraitOrSignature >::send_exit ( const ActorHandle & whom,
error reason )

Sends an exit message to receiver.

◆ set_default_handler()

template<class TraitOrSignature >
template<class Fun >
void caf::typed_actor_view< TraitOrSignature >::set_default_handler ( Fun && fun)

◆ set_down_handler()

template<class TraitOrSignature >
template<class Fun >
void caf::typed_actor_view< TraitOrSignature >::set_down_handler ( Fun && fun)

◆ set_error_handler()

template<class TraitOrSignature >
template<class Fun >
void caf::typed_actor_view< TraitOrSignature >::set_error_handler ( Fun && fun)

◆ set_exit_handler()

template<class TraitOrSignature >
template<class Fun >
void caf::typed_actor_view< TraitOrSignature >::set_exit_handler ( Fun && fun)

◆ set_node_down_handler()

template<class TraitOrSignature >
template<class Fun >
void caf::typed_actor_view< TraitOrSignature >::set_node_down_handler ( Fun && fun)

◆ spawn() [1/2]

template<class TraitOrSignature >
template<spawn_options Os = no_spawn_options, class F , class... Ts>
infer_handle_from_fun_t< F > caf::typed_actor_view< TraitOrSignature >::spawn ( F fun,
Ts &&... xs )

◆ spawn() [2/2]

template<class TraitOrSignature >
template<class T , spawn_options Os = no_spawn_options, class... Ts>
infer_handle_from_class_t< T > caf::typed_actor_view< TraitOrSignature >::spawn ( Ts &&... xs)

◆ system()

template<class TraitOrSignature >
auto & caf::typed_actor_view< TraitOrSignature >::system ( ) const
noexcept

Returns the hosting actor system.

◆ unlink_from()

template<class TraitOrSignature >
template<class ActorHandle >
void caf::typed_actor_view< TraitOrSignature >::unlink_from ( const ActorHandle & x)

Unlinks this actor from addr.


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