FileDescriptor

struct FileDescriptor

File descriptor.

The intention is to manage the life-time of a file descriptor almost as if it was a std::unique_ptr disallowing inadverent copying and ensuring the automatic release of resources.

The are however no strong guarantees: it is just too easy to access and copy the real file descriptor (the integer).

Subclassed by roq::io::fs::File, roq::io::fs::SharedMemory

Public Types

using value_type = int

Public Functions

inline explicit FileDescriptor(value_type fd)
inline FileDescriptor(FileDescriptor &&rhs)
FileDescriptor(FileDescriptor const&) = delete
void operator=(FileDescriptor const&) = delete
virtual ~FileDescriptor()
inline value_type get() const
inline value_type fd() const
inline value_type release()