23 #ifndef LELY_COAPP_FIBER_DRIVER_HPP_ 24 #define LELY_COAPP_FIBER_DRIVER_HPP_ 85 template <
class F,
class... Args>
88 GetStrand().post(::std::forward<F>(f), ::std::forward<Args>(args)...);
108 return f.
get().value();
124 typename ::std::enable_if<!::std::is_void<T>::value, T>::type
128 return f.
get().value();
129 }
catch (const ::std::system_error& e) {
151 void USleep(uint_least64_t usec);
157 void USleep(uint_least64_t usec, ::std::error_code& ec);
164 #endif // LELY_COAPP_FIBER_DRIVER_HPP_ void Defer(F &&f, Args &&... args)
Schedules the specified Callable object for execution by strand for this driver.
const struct ev_exec_vtbl *const ev_exec_t
An abstract task executor.
An asynchronous CANopen master.
The base class for drivers for remote CANopen nodes.
Convenience class providing a RAII-style mechanism to ensure the calling thread can be used by fiber ...
A CANopen driver running its tasks and callbacks in fibers.
This header file is part of the event library; it contains the C++ interface for the fiber executor...
The exception thrown when retrieving the result of a future which is not ready or does not contain a ...
A base class for lely::canopen::FiberDriver, containing a fiber executor.
FiberDriver(AsyncMaster &master, uint8_t id)
Creates a new CANopen driver and its associated fiber executor.
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.
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 strand executor...
An abstract task executor. This class is a wrapper around ev_exec_t*.
result_type & get()
Returns the result of a ready future.
::std::error_code make_error_code(SdoErrc e) noexcept
Creates an error code corresponding to an SDO abort code.
ev::Executor GetStrand() const noexcept
Returns the strand executor associated with the driver.
T Wait(SdoFuture< T > f)
Waits for the specified future to become ready by suspending the calling fiber.