libcaf  0.15.0
Public Types | Public Member Functions | Related Functions | List of all members
caf::function_view< Actor > Class Template Reference

A function view for an actor hides any messaging from the caller. More...

#include <function_view.hpp>

Public Types

using type = Actor
 

Public Member Functions

 function_view (const type &impl)
 
 function_view (function_view &&x)
 
function_viewoperator= (function_view &&x)
 
template<class... Ts, class R = typename function_view_flattened_result< typename detail::deduce_output_type< type, detail::type_list< typename detail::implicit_conversions< typename std::decay<Ts>::type >::type...> >::tuple_type >::type>
operator() (Ts &&...xs)
 Sends a request message to the assigned actor and returns the result. More...
 
void assign (type x)
 
 operator bool () const
 Checks whether this function view has an actor assigned to it.
 

Related Functions

(Note that these are not member functions.)

template<class T >
bool operator== (const function_view< T > &x, std::nullptr_t)
 
template<class T >
bool operator== (std::nullptr_t x, const function_view< T > &y)
 
template<class T >
bool operator!= (const function_view< T > &x, std::nullptr_t y)
 
template<class T >
bool operator!= (std::nullptr_t x, const function_view< T > &y)
 
template<class T >
function_view< T > make_function_view (const T &x)
 Creates a new function view for x.
 

Detailed Description

template<class Actor>
class caf::function_view< Actor >

A function view for an actor hides any messaging from the caller.

Internally, a function view uses a scoped_actor and uses blocking send and receive operations.

Member Function Documentation

template<class Actor >
template<class... Ts, class R = typename function_view_flattened_result< typename detail::deduce_output_type< type, detail::type_list< typename detail::implicit_conversions< typename std::decay<Ts>::type >::type...> >::tuple_type >::type>
R caf::function_view< Actor >::operator() ( Ts &&...  xs)

Sends a request message to the assigned actor and returns the result.

Exceptions
std::bad_function_callif no actor is assigned to view
actor_exitedif the requests resulted in an error

Friends And Related Function Documentation

template<class T >
bool operator!= ( const function_view< T > &  x,
std::nullptr_t  y 
)
related
template<class T >
bool operator!= ( std::nullptr_t  x,
const function_view< T > &  y 
)
related
template<class T >
bool operator== ( const function_view< T > &  x,
std::nullptr_t   
)
related
template<class T >
bool operator== ( std::nullptr_t  x,
const function_view< T > &  y 
)
related

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