![]() |
VSM C++ SDK
Vehicle Specific Modules SDK
|
Linux-specific implementation for I/O controller. More...
#include <poll_io_controller.h>
Classes | |
struct | Io_cb |
Control block for I/O operation. More... | |
Public Member Functions | |
virtual void | Enable () override |
Enable the controller. More... | |
virtual void | Disable () override |
Disable the controller. More... | |
virtual void | Register_handle (File_processor::Stream::Native_handle &) override |
Register new opened file handle. More... | |
virtual void | Unregister_handle (File_processor::Stream::Native_handle &) override |
Unregister previously registered file handle. More... | |
void | Delete_handle (int fd) |
Delete handle. More... | |
bool | Queue_operation (Io_cb &io_cb) |
Queue IO operation. More... | |
bool | Cancel_operation (Io_cb &io_cb) |
Cancel pending operation. More... | |
Additional Inherited Members | |
![]() | |
static std::unique_ptr < Native_controller > | Create () |
Create controller instance. More... | |
Linux-specific implementation for I/O controller.
bool ugcs::vsm::internal::Poll_io_controller::Cancel_operation | ( | Io_cb & | io_cb | ) |
Cancel pending operation.
io_cb | Operation control block. |
void ugcs::vsm::internal::Poll_io_controller::Delete_handle | ( | int | fd | ) |
Delete handle.
Possibly deferred. This is a workaround of kernel panic bug in OSX. The scenario: 1) create pipe with descriptors p1, p2. 2) open serial port with descriptor fd. 3) poll on two descriptors p1 and fd in separate thread. 4) issue write on p2. This triggers read event on p1 and wakes up poll(). 5) close(fd)
Results:
Do not close the fd while it is in polling state. Close it after poll returns.
|
overridevirtual |
Disable the controller.
Implements ugcs::vsm::File_processor::Native_controller.
|
overridevirtual |
Enable the controller.
Implements ugcs::vsm::File_processor::Native_controller.
bool ugcs::vsm::internal::Poll_io_controller::Queue_operation | ( | Io_cb & | io_cb | ) |
Queue IO operation.
The provided callback is called when the operation completes with Io_cb structure filled.
|
inlineoverridevirtual |
Register new opened file handle.
Implements ugcs::vsm::File_processor::Native_controller.
|
inlineoverridevirtual |
Unregister previously registered file handle.
Implements ugcs::vsm::File_processor::Native_controller.