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 int m_descriptor
Definition: FileDescriptor.h:105
Definition: DriveElementFromInputBehavior.cpp:27
bool isValid() const
Checks if the file descriptor is valid, i.e.
Definition: FileDescriptor.cpp:63
FileDescriptor & operator=(FileDescriptor &&other)
Move assignment operator.
Definition: FileDescriptor.cpp:49
bool m_canRead
Definition: FileDescriptor.h:106
bool readBytes(void *dataBuffer, size_t bytesToRead, size_t *bytesActuallyRead)
Reads bytes from the file descriptor.
Definition: FileDescriptor.cpp:149
FileDescriptor()
Default constructor.
Definition: FileDescriptor.cpp:34
A wrapper for an UNIX-style integer file descriptor.
Definition: FileDescriptor.h:29
string(TOUPPER ${DEVICE}DEVICE_UPPER_CASE) option(BUILD_DEVICE_ $
Definition: CMakeLists.txt:35
bool openForWriting(const std::string &path)
Attempts to open the file descriptor for writing only.
Definition: FileDescriptor.cpp:102
~FileDescriptor()
Destructor.
Definition: FileDescriptor.cpp:58
bool m_canWrite
Definition: FileDescriptor.h:107
bool canWrite() const
Determines if the file descriptor can be written to.
Definition: FileDescriptor.cpp:73
static const int INVALID_VALUE
Definition: FileDescriptor.h:103
bool openForReading(const std::string &path)
Attempts to open the file descriptor for reading only.
Definition: FileDescriptor.cpp:93
bool hasDataToRead() const
Checks whether this object has data available to be read.
Definition: FileDescriptor.cpp:132
bool openForReadingAndMaybeWriting(const std::string &path)
Attempts to open the file descriptor for reading and (if permissions allow it) writing.
Definition: FileDescriptor.cpp:111
bool canRead() const
Determines if the file descriptor can be read from.
Definition: FileDescriptor.cpp:68
bool openForReadingAndWriting(const std::string &path)
Attempts to open the file descriptor for reading and writing.
Definition: FileDescriptor.cpp:84
void reset()
Resets the file descriptor back to an invalid state.
Definition: FileDescriptor.cpp:123