26#ifndef NIDAS_CORE_IODEVICE_H
27#define NIDAS_CORE_IODEVICE_H
34namespace nidas {
namespace core {
52 virtual void setName(
const std::string& val)
57 virtual const std::string&
getName()
const
70 virtual void open(
int flags) = 0;
87 virtual size_t read(
void *buf,
size_t len) = 0;
94 virtual size_t read(
void *buf,
size_t len,
int msecTimeout) = 0;
136 virtual size_t write(
const void *buf,
size_t len) = 0;
145 virtual void ioctl(
int request,
void* buf,
size_t len) = 0;
#define err(format, arg...)
Definition ck_lams.cc:55
An interface to an IO device.
Definition IODevice.h:42
virtual void ioctl(int request, void *buf, size_t len)=0
std::string _devname
Whether to reopen this sensor on an IOException.
Definition IODevice.h:161
IODevice(const IODevice &)
Derived classes don't implement copy so we won't here.
virtual size_t read(void *buf, size_t len, int msecTimeout)=0
Read from the sensor with a millisecond timeout.
virtual int getWriteFd() const =0
The file descriptor used when writing to this sensor.
virtual ~IODevice()
Definition IODevice.h:47
virtual size_t write(const void *buf, size_t len)=0
Write to the sensor.
virtual const std::string & getName() const
Definition IODevice.h:57
virtual size_t read(void *buf, size_t len)=0
Read from the sensor.
virtual void close()=0
Close the device.
virtual int getReadFd() const =0
The file descriptor used when reading from this sensor.
virtual void open(int flags)=0
Open the device.
virtual void setName(const std::string &val)
Set the device name to be opened for this sensor.
Definition IODevice.h:52
virtual size_t getBytesAvailable() const
Return how many bytes are available to read on this IODevice.
Definition IODevice.h:122
IODevice()
Definition IODevice.h:45
IODevice & operator=(const IODevice &)
Derived classes don't implement assignment so we won't here.
Definition IOException.h:37
Sample * getSample(sampleType type, unsigned int len)
A convienence method for getting a sample of an enumerated type from a pool.
Definition Sample.cc:70
Root namespace for the NCAR In-Situ Data Acquisition Software.
Definition A2DConverter.h:31
int len
Definition sing.cc:948