Go to the documentation of this file.
16 #ifndef SURGSIM_DEVICES_MULTIAXIS_LINUX_FILEDESCRIPTOR_H
17 #define SURGSIM_DEVICES_MULTIAXIS_LINUX_FILEDESCRIPTOR_H
69 bool readBytes(
void* dataBuffer,
size_t bytesToRead,
size_t* bytesActuallyRead);
113 #endif // SURGSIM_DEVICES_MULTIAXIS_LINUX_FILEDESCRIPTOR_H
bool openForReadingAndMaybeWriting(const std::string &path)
Attempts to open the file descriptor for reading and (if permissions allow it) writing.
Definition: FileDescriptor.cpp:111
void reset()
Resets the file descriptor back to an invalid state.
Definition: FileDescriptor.cpp:123
FileDescriptor()
Default constructor.
Definition: FileDescriptor.cpp:34
bool hasDataToRead() const
Checks whether this object has data available to be read.
Definition: FileDescriptor.cpp:132
FileDescriptor & operator=(FileDescriptor &&other)
Move assignment operator.
Definition: FileDescriptor.cpp:49
int m_descriptor
Definition: FileDescriptor.h:105
Definition: CompoundShapeToGraphics.cpp:30
bool openForWriting(const std::string &path)
Attempts to open the file descriptor for writing only.
Definition: FileDescriptor.cpp:102
bool canWrite() const
Determines if the file descriptor can be written to.
Definition: FileDescriptor.cpp:73
bool canRead() const
Determines if the file descriptor can be read from.
Definition: FileDescriptor.cpp:68
bool readBytes(void *dataBuffer, size_t bytesToRead, size_t *bytesActuallyRead)
Reads bytes from the file descriptor.
Definition: FileDescriptor.cpp:149
bool m_canWrite
Definition: FileDescriptor.h:107
static const int INVALID_VALUE
Definition: FileDescriptor.h:103
bool m_canRead
Definition: FileDescriptor.h:106
~FileDescriptor()
Destructor.
Definition: FileDescriptor.cpp:58
int get() const
Gets the raw underlying OS file descriptor.
Definition: FileDescriptor.cpp:78
FileDescriptor & operator=(const FileDescriptor &other)=delete
bool openForReading(const std::string &path)
Attempts to open the file descriptor for reading only.
Definition: FileDescriptor.cpp:93
bool openForReadingAndWriting(const std::string &path)
Attempts to open the file descriptor for reading and writing.
Definition: FileDescriptor.cpp:84
string(TOUPPER ${DEVICE} DEVICE_UPPER_CASE) option(BUILD_DEVICE_$
Definition: CMakeLists.txt:38
bool isValid() const
Checks if the file descriptor is valid, i.e.
Definition: FileDescriptor.cpp:63
FileDescriptor(const FileDescriptor &other)=delete
A wrapper for an UNIX-style integer file descriptor.
Definition: FileDescriptor.h:30