FileDescriptor Class Reference
|
Space-ng SDK
|
sol3::core::FileDescriptor Class Reference
RAII wrapper for POSIX file descriptors. More...
#include <sol3/core/file_descriptor.h>
Public Member Functions | |
| FileDescriptor (int fd=-1) | |
| Constructs a FileDescriptor. More... | |
| ~FileDescriptor () | |
| FileDescriptor (FileDescriptor const &)=delete | |
| FileDescriptor & | operator= (FileDescriptor const &)=delete |
| FileDescriptor (FileDescriptor &&other) noexcept | |
| FileDescriptor & | operator= (FileDescriptor &&other) noexcept |
| bool | isOpen () const |
| Return true if the file descriptor is open, false otherwise. More... | |
| int | get () const |
| Return the underlying file descriptor. More... | |
| void | reset (int fd=-1) |
| Closes and replaces the underlying file descriptor. More... | |
Detailed Description
RAII wrapper for POSIX file descriptors.
Automatically closes the file descriptor when the object is destroyed.
Constructor & Destructor Documentation
◆ FileDescriptor() [1/3]
|
explicit |
Constructs a FileDescriptor.
- Parameters
-
f The file descriptor to manage.
◆ ~FileDescriptor()
| sol3::core::FileDescriptor::~FileDescriptor | ( | ) |
◆ FileDescriptor() [2/3]
|
delete |
◆ FileDescriptor() [3/3]
|
noexcept |
Member Function Documentation
◆ get()
| int sol3::core::FileDescriptor::get | ( | ) | const |
Return the underlying file descriptor.
◆ isOpen()
| bool sol3::core::FileDescriptor::isOpen | ( | ) | const |
Return true if the file descriptor is open, false otherwise.
◆ operator=() [1/2]
|
noexcept |
◆ operator=() [2/2]
|
delete |
◆ reset()
| void sol3::core::FileDescriptor::reset | ( | int | fd = -1 | ) |
Closes and replaces the underlying file descriptor.
The documentation for this class was generated from the following file:
- /workspaces/astro/sol3-sdk/cpp/sol3/core/file_descriptor.h
Generated by