libcaf  0.15.3
Public Types | Public Member Functions | Friends | List of all members
caf::message_handler Class Reference

A partial function implementation used to process a message. More...

#include <message_handler.hpp>

Public Types

using impl_ptr = intrusive_ptr< detail::behavior_impl >
 A pointer to the underlying implementation.
 

Public Member Functions

 message_handler (message_handler &&)=default
 
 message_handler (const message_handler &)=default
 
message_handleroperator= (message_handler &&)=default
 
message_handleroperator= (const message_handler &)=default
 
const impl_ptras_behavior_impl () const
 Returns a pointer to the implementation.
 
 message_handler (impl_ptr ptr)
 Creates a message handler from ptr.
 
 operator bool () const
 Checks whether the message handler is not empty.
 
template<class T , class... Ts>
 message_handler (const T &v, Ts &&...xs)
 Create a message handler a list of match expressions, functors, or other message handlers. More...
 
template<class... Ts>
void assign (Ts...xs)
 Assigns new message handlers.
 
void assign (message_handler what)
 Equal to *this = other.
 
optional< messageoperator() (message &arg)
 Runs this handler and returns its (optional) result.
 
optional< messageoperator() (type_erased_tuple &xs)
 Runs this handler and returns its (optional) result.
 
match_case::result operator() (detail::invoke_result_visitor &f, type_erased_tuple &xs)
 Runs this handler with callback.
 
match_case::result operator() (detail::invoke_result_visitor &f, message &xs)
 Runs this handler with callback.
 
template<class... Ts>
std::conditional< detail::disjunction< may_have_timeout< typename std::decay< Ts >::type >::value... >::value, behavior, message_handler >::type or_else (Ts &&...xs) const
 Returns a new handler that concatenates this handler with a new handler from xs.... More...
 

Friends

class behavior
 

Detailed Description

A partial function implementation used to process a message.

Constructor & Destructor Documentation

template<class T , class... Ts>
caf::message_handler::message_handler ( const T &  v,
Ts &&...  xs 
)

Create a message handler a list of match expressions, functors, or other message handlers.

Member Function Documentation

template<class... Ts>
std::conditional< detail::disjunction<may_have_timeout< typename std::decay<Ts>::type>::value... >::value, behavior, message_handler >::type caf::message_handler::or_else ( Ts &&...  xs) const

Returns a new handler that concatenates this handler with a new handler from xs....


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