Lely core libraries  2.2.5
dev.h File Reference
#include <lely/ev/ev.h>
#include <lely/io2/io2.h>
#include <stddef.h>
Include dependency graph for dev.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  io_dev_vtbl
 

Typedefs

typedef const struct io_dev_vtbl *const io_dev_t
 An abstract I/O device.
 

Functions

io_ctx_tio_dev_get_ctx (const io_dev_t *dev)
 Returns a pointer to the I/O context with which the I/O device is registered.
 
ev_exec_tio_dev_get_exec (const io_dev_t *dev)
 Returns a pointer to the executor used by the I/O device to execute asynchronous tasks.
 
size_t io_dev_cancel (io_dev_t *dev, struct ev_task *task)
 Cancels the asynchronous operation submitted to *dev, if its task has not yet been submitted to its executor, or all pending operations if task is NULL. More...
 
size_t io_dev_abort (io_dev_t *dev, struct ev_task *task)
 Aborts the asynchronous operation submitted to *dev, if its task has not yet been submitted to its executor, or all pending operations if task is NULL. More...
 

Detailed Description

This header file is part of the I/O library; it contains the abstract I/O device interface.

Author
J. S. Seldenthuis jseld.nosp@m.enth.nosp@m.uis@l.nosp@m.ely..nosp@m.com

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Definition in file dev.h.

Function Documentation

◆ io_dev_cancel()

size_t io_dev_cancel ( io_dev_t dev,
struct ev_task task 
)
inline

Cancels the asynchronous operation submitted to *dev, if its task has not yet been submitted to its executor, or all pending operations if task is NULL.

All canceled tasks are submitted for execution before this function returns. If and how cancellation is reported to the tasks depends on the type of the I/O device and the asynchronous operation.

Returns
the number of aborted tasks.

Definition at line 92 of file dev.h.

◆ io_dev_abort()

size_t io_dev_abort ( io_dev_t dev,
struct ev_task task 
)
inline

Aborts the asynchronous operation submitted to *dev, if its task has not yet been submitted to its executor, or all pending operations if task is NULL.

Aborted tasks are not submitted for execution.

Returns
the number of aborted tasks.

Definition at line 98 of file dev.h.