AsyncBerkeley
Asynchronous Berkeley sockets. Simple.
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
io::execution::basic_triggers< Mux > Class Template Reference

A class that provides a high-level interface for an executor. More...

#include <io/execution/triggers.hpp>

Public Types

using socket_handle = ::io::socket::socket_handle
 The socket handle type.
 
using socket_dialog = ::io::socket::socket_dialog< Mux >
 The socket dialog type.
 
using executor_type = executor< Mux >
 The executor type.
 

Public Member Functions

 basic_triggers ()=default
 Default constructor.
 
 basic_triggers (const basic_triggers &)=delete
 Deleted copy constructor.
 
 basic_triggers (basic_triggers &&)=default
 Default move constructor.
 
template<AllocatorLike Allocator>
 basic_triggers (const Allocator &alloc=Allocator()) noexcept(noexcept(Allocator()))
 Construct with an allocator.
 
auto operator= (const basic_triggers &) -> basic_triggers &=delete
 Deleted copy assignment operator.
 
auto operator= (basic_triggers &&) -> basic_triggers &=default
 Default move assignment operator.
 
template<SocketLike Socket>
auto push (std::shared_ptr< Socket > socket) -> socket_dialog
 Constructs a socket_dialog associated to the executor.
 
template<typename... Args>
auto emplace (Args &&...args) -> socket_dialog
 In-place constructs a socket_dialog associated to the executor.
 
template<typename... Args>
auto set (Args &&...args) -> decltype(auto)
 Sets a completion handler for an event.
 
constexpr auto wait_for (int interval=-1) -> decltype(auto)
 Waits for events to occur.
 
constexpr auto wait () -> decltype(auto)
 Waits for events to occur.
 
auto on_empty () -> decltype(auto)
 Sends a notice when the triggers are empty.
 
auto get_executor () const noexcept -> std::weak_ptr< executor_type >
 Gets the executor.
 
 ~basic_triggers ()=default
 Default destructor.
 

Detailed Description

template<Multiplexer Mux>
class io::execution::basic_triggers< Mux >

A class that provides a high-level interface for an executor.

Template Parameters
MuxThe multiplexer type.

Member Function Documentation

◆ emplace()

template<Multiplexer Mux>
template<typename... Args>
auto io::execution::basic_triggers< Mux >::emplace ( Args &&...  args) -> socket_dialog
inline

In-place constructs a socket_dialog associated to the executor.

Template Parameters
ArgsThe argument types to be forwarded to the executor.
Parameters
...argsThe arguments to forward to the socket handle constructor.
Returns
A shared pointer to the emplaced socket handle.

◆ get_executor()

template<Multiplexer Mux>
auto io::execution::basic_triggers< Mux >::get_executor ( ) const -> std::weak_ptr<executor_type>
inlinenoexcept

Gets the executor.

Returns
A weak pointer to the executor.

◆ on_empty()

template<Multiplexer Mux>
auto io::execution::basic_triggers< Mux >::on_empty ( ) -> decltype(auto)
inline

Sends a notice when the triggers are empty.

Returns
A sender that notifies when the triggers are empty.

◆ push()

template<Multiplexer Mux>
template<SocketLike Socket>
auto io::execution::basic_triggers< Mux >::push ( std::shared_ptr< Socket >  socket) -> socket_dialog
inline

Constructs a socket_dialog associated to the executor.

This method can be used to create socket dialogs with a custom allocator.

Template Parameters
SocketThe socket like object to use in the socket_dialog.
Parameters
socketA shared pointer to the socket handle.
Returns
A socket_dialog to be used in asynchronous I/O.

◆ set()

template<Multiplexer Mux>
template<typename... Args>
auto io::execution::basic_triggers< Mux >::set ( Args &&...  args) -> decltype(auto)
inline

Sets a completion handler for an event.

Parameters
argsThe arguments to perfectly forward to the executor.
Template Parameters
ArgsThe argument types to perfectly forward.
Returns
A sender that will complete when the event occurs.

◆ wait()

template<Multiplexer Mux>
constexpr auto io::execution::basic_triggers< Mux >::wait ( ) -> decltype(auto)
inlineconstexpr

Waits for events to occur.

Returns
A sender that will complete when events occur.

◆ wait_for()

template<Multiplexer Mux>
constexpr auto io::execution::basic_triggers< Mux >::wait_for ( int  interval = -1) -> decltype(auto)
inlineconstexpr

Waits for events to occur.

Parameters
intervalThe maximum time to wait for, in milliseconds.
Returns
A sender that will complete when events occur.

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