23#ifndef LELY_COAPP_FIBER_DRIVER_HPP_
24#define LELY_COAPP_FIBER_DRIVER_HPP_
85 template <
class F,
class...
Args>
109 return f.get().value();
111 util::throw_error_code(
"Wait", ::std::errc::operation_canceled);
128 typename ::std::enable_if<!::std::is_void<T>::value, T>::type
132 return f.get().value();
133 }
catch (const ::std::system_error&
e) {
136 ec = ::std::make_error_code(::std::errc::operation_canceled);
An asynchronous CANopen master.
The base class for drivers for remote CANopen nodes.
uint8_t id() const noexcept final
Returns the node-ID.
BasicMaster & master
A reference to the master with which this driver is registered.
A CANopen driver running its tasks and callbacks in fibers.
void Defer(F &&f, Args &&... args)
Schedules the specified Callable object for execution by strand for this driver.
FiberDriver(AsyncMaster &master, uint8_t id)
Creates a new CANopen driver and its associated fiber executor.
T Wait(SdoFuture< T > f)
Waits for the specified future to become ready by suspending the calling fiber.
typename::std::enable_if<!::std::is_void< T >::value, T >::type Wait(SdoFuture< T > f, ::std::error_code &ec)
Waits for the specified future to become ready by suspending the calling fiber.
void USleep(uint_least64_t usec)
Suspends the calling fiber for usec microseconds.
ev::Executor GetStrand() const noexcept
Returns the strand executor associated with the driver.
A base class for lely::canopen::FiberDriver, containing a fiber executor.
An abstract task executor. This class is a wrapper around #ev_exec_t*.
void post(ev_task &task) noexcept
Convenience class providing a RAII-style mechanism to ensure the calling thread can be used by fiber ...
The exception thrown when retrieving the result of a future which is not ready or does not contain a ...
This header file is part of the C++ CANopen application library; it contains the remote node driver i...
This header file is part of the event library; it contains the C++ interface for the fiber executor,...
const struct ev_exec_vtbl *const ev_exec_t
An abstract task executor.
This header file is part of the event library; it contains the C++ interface for the strand executor.