Lely core libraries 2.3.4
lely::io::CoCanChannelWrite Class Referenceabstract

A CAN channel write operation with a stackless coroutine as the completion task. More...

#include <co_can.hpp>

Inheritance diagram for lely::io::CoCanChannelWrite:
Collaboration diagram for lely::io::CoCanChannelWrite:

Public Member Functions

 CoCanChannelWrite (const can_msg *msg, ev_exec_t *exec=nullptr) noexcept
 Constructs a write operation.
 
ev::Executor get_executor () const noexcept
 Returns the executor to which the completion task is (to be) submitted.
 
virtual void operator() (::std::error_code ec) noexcept=0
 The coroutine to be executed once the write operation completes (or is canceled).
 
- Public Member Functions inherited from lely::util::Coroutine
void restart () noexcept
 Resets the stackless coroutine so the next invocation starts at the beginning.
 
bool is_ready () const noexcept
 Returns true if the stackless coroutine has finished.
 
bool is_parent () const noexcept
 Returns true if the stackless coroutine is the parent of a fork.
 
bool is_child () const noexcept
 Returns true if the stackless coroutine is the child of a fork.
 

Additional Inherited Members

- Data Fields inherited from io_can_chan_write
const struct can_msgmsg
 A pointer to the CAN frame to be written.
 
struct ev_task task
 The task (to be) submitted upon completion (or cancellation) of the write operation.
 
int errc
 The error number, obtained as if by get_errc(), if an error occurred or the operation was canceled.
 

Detailed Description

A CAN channel write operation with a stackless coroutine as the completion task.

Definition at line 86 of file co_can.hpp.

Member Function Documentation

◆ operator()()

virtual void lely::io::CoCanChannelWrite::operator() ( ::std::error_code  ec)
pure virtualnoexcept

The coroutine to be executed once the write operation completes (or is canceled).

Parameters
ecthe error code, or 0 on success.

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