|
| template<typename SyncProcedure > |
| bool | add (std::string_view name, args_specs< SyncProcedure > arg_specs, SyncProcedure &&fct) |
| | Add a synchronous procedure to the dispatcher. More...
|
| |
|
template<typename SyncProcedure > |
| bool | add (std::string_view name, SyncProcedure &&fct) |
| | This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
| |
| template<typename AsyncProcedure > |
| bool | add_async (std::string_view name, args_specs< AsyncProcedure > arg_specs, AsyncProcedure &&fct) |
| | Add an asynchronous procedure to the dispatcher. More...
|
| |
|
template<typename AsyncProcedure > |
| bool | add_async (std::string_view name, AsyncProcedure &&fct) |
| | This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
| |
| template<typename Executor , typename CoroProcedure , std::size_t N = internal::func_traits<CoroProcedure>::args_count> |
| bool | add_coro (std::string_view name, const Executor &executor, args_specs< CoroProcedure > arg_specs, CoroProcedure &&coro) |
| | Add a coroutine to the dispatcher. More...
|
| |
|
template<typename Executor , typename CoroProcedure > |
| bool | add_coro (std::string_view name, const Executor &executor, CoroProcedure &&coro) |
| | This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
| |
|
template<typename ExecutionContext , typename CoroProcedure , std::size_t N = internal::func_traits<CoroProcedure>::args_count> |
| bool | add_coro (std::string_view name, ExecutionContext &ctx, args_specs< CoroProcedure > arg_specs, CoroProcedure &&coro) |
| | This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
| |
|
template<typename ExecutionContext , typename CoroProcedure > |
| bool | add_coro (std::string_view name, ExecutionContext &ctx, CoroProcedure &&coro) |
| | This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
| |
| bool | remove (const std::string &name) |
| | Remove a procedure from the dispatcher. More...
|
| |
| bool | has (const std::string &name) const |
| | Check if a procedure is registered. More...
|
| |
| size_t | clear () |
| | Remove all procedures. More...
|
| |
| std::vector< std::string > | known () const |
| | Get the name of all known procedures. More...
|
| |
template<typename Rpc, template< class... > class Map = default_map, typename Lockable = default_mutex>
class packio::dispatcher< Rpc, Map, Lockable >
The dispatcher class, used to store and dispatch procedures.
- Template Parameters
-
| Rpc | RPC protocol implementation |
| Map | The container used to associate procedures to their name |
| Lockable | The lockable used to protect accesses to the procedure map |
template<typename Rpc , template< class... > class Map = default_map, typename Lockable = default_mutex>
template<typename Executor , typename CoroProcedure , std::size_t N = internal::func_traits<CoroProcedure>::args_count>
| bool packio::dispatcher< Rpc, Map, Lockable >::add_coro |
( |
std::string_view |
name, |
|
|
const Executor & |
executor, |
|
|
args_specs< CoroProcedure > |
arg_specs, |
|
|
CoroProcedure && |
coro |
|
) |
| |
|
inline |
Add a coroutine to the dispatcher.
- Parameters
-
| name | The name of the procedure |
| executor | The executor used to execute the coroutine |
| arg_specs | The argument specifications (optional) |
| coro | The coroutine to use as procedure |