A strategy for a device.
More...
#include <device.h>
|
virtual size_t | read (CType dev, void *buf, size_t sz, size_t elem)=0 |
| Service a read operation. More...
|
|
virtual size_t | write (CType dev, const void *buf, size_t sz, size_t elem)=0 |
| Service a write operation. More...
|
|
virtual int | seek (CType dev, off_t offset, wfio_whence_t whence)=0 |
| Service a seek operation. More...
|
|
virtual off_t | tell (CType dev)=0 |
| Service a tell operation. More...
|
|
virtual int | flush (CType dev)=0 |
| Service a flush operation. More...
|
|
virtual size_t | setbufsz (CType dev, size_t len)=0 |
| Service a setbufsz operation. More...
|
|
virtual size_t | getbufsz (CType dev) const =0 |
| Service a getbufsz operation. More...
|
|
virtual int | dcntl (CType dev, int cmd, va_list args)=0 |
| Service a dcntl operation. More...
|
|
virtual int | ioctl (CType dev, int cmd, va_list args)=0 |
| Service an ioctl operation. More...
|
|
virtual | ~CXXStrategy () |
|
A strategy for a device.
A class of this instance can be supplied to a device to quickly implement a device in C++.
◆ ~CXXStrategy()
virtual wfio::Device::CXXStrategy::~CXXStrategy |
( |
| ) |
|
|
virtual |
◆ dcntl()
virtual int wfio::Device::CXXStrategy::dcntl |
( |
CType |
dev, |
|
|
int |
cmd, |
|
|
va_list |
args |
|
) |
| |
|
pure virtual |
Service a dcntl operation.
- Parameters
-
dev | The context from which this method was invoked. |
cmd | The command to send to the device. |
va | Additional arguments to the dcntl. |
◆ flush()
virtual int wfio::Device::CXXStrategy::flush |
( |
CType |
dev | ) |
|
|
pure virtual |
Service a flush operation.
- Parameters
-
dev | The context from which this method was invoked. |
- Returns
- Nonzero on success; otherwise, zero.
◆ getbufsz()
virtual size_t wfio::Device::CXXStrategy::getbufsz |
( |
CType |
dev | ) |
const |
|
pure virtual |
Service a getbufsz operation.
- Parameters
-
dev | The context from which this method was invoked. |
- Returns
- The number of elements actually written on success; otherwise, WFIO_NPOS.
◆ ioctl()
virtual int wfio::Device::CXXStrategy::ioctl |
( |
CType |
dev, |
|
|
int |
cmd, |
|
|
va_list |
args |
|
) |
| |
|
pure virtual |
Service an ioctl operation.
- Parameters
-
dev | The context from which this method was invoked. |
cmd | The command to send to the device. |
va | Additional arguments to the dcntl. |
◆ read()
virtual size_t wfio::Device::CXXStrategy::read |
( |
CType |
dev, |
|
|
void * |
buf, |
|
|
size_t |
sz, |
|
|
size_t |
elem |
|
) |
| |
|
pure virtual |
Service a read operation.
- Parameters
-
dev | The context from which this method was invoked. |
buf | The buffer to read into. |
sz | The size of each element to read. |
elem | The number of elements to read. |
- Returns
- The number of elements actually read on success; otherwise, WFIO_NPOS.
◆ seek()
Service a seek operation.
- Parameters
-
dev | The context from which this method was invoked. |
buf | The buffer to write from. |
sz | The size of each elements. |
elem | The maximum number of elements to write. |
- Returns
- Zero on success; otherwise, nonzero.
◆ setbufsz()
virtual size_t wfio::Device::CXXStrategy::setbufsz |
( |
CType |
dev, |
|
|
size_t |
len |
|
) |
| |
|
pure virtual |
Service a setbufsz operation.
- Parameters
-
dev | The context from which this method was invoked. |
sz | The requested size to set. |
- Returns
- The size of the buffer after this operation; otherwise,WFIO_NPOS. A return value of zero shall indicate that device is unbuffered..
◆ tell()
virtual off_t wfio::Device::CXXStrategy::tell |
( |
CType |
dev | ) |
|
|
pure virtual |
Service a tell operation.
- Parameters
-
dev | The context from which this method was invoked. |
- Returns
- The current stream position of the device on success; otherwise,WFIO_NPOS.
◆ write()
virtual size_t wfio::Device::CXXStrategy::write |
( |
CType |
dev, |
|
|
const void * |
buf, |
|
|
size_t |
sz, |
|
|
size_t |
elem |
|
) |
| |
|
pure virtual |
Service a write operation.
- Parameters
-
dev | The context from which this method was invoked. |
buf | The buffer to write from. |
sz | The size of each elements. |
elem | The maximum number of elements to write. |
- Returns
- The number of elements actually written on success; otherwise, WFIO_NPOS.
The documentation for this class was generated from the following file: