MySQL 9.1.0
Source Code Documentation
|
Captures ownership and manages lifetime of an already opened OS file descriptor. More...
#include <ddl0ddl.h>
Public Member Functions | |
Unique_os_file_descriptor ()=default | |
Default constructor, does not hold any file, does not close any on destruction. More... | |
Unique_os_file_descriptor (os_fd_t fd) | |
Main constructor capturing an already opened OS file descriptor. More... | |
Unique_os_file_descriptor (Unique_os_file_descriptor &&other) | |
~Unique_os_file_descriptor () | |
os_fd_t | get () const |
Returns the managed OS file descriptor for use with OS functions that operate on file. More... | |
bool | is_open () const |
Unique_os_file_descriptor & | operator= (Unique_os_file_descriptor &&other) |
void | swap (Unique_os_file_descriptor &other) |
Swaps the underlying managed file descriptors between two instances of Unique_os_file_descriptor. More... | |
void | close () |
Closes the managed file. More... | |
Private Attributes | |
os_fd_t | m_fd {OS_FD_CLOSED} |
Additional Inherited Members | |
Private Member Functions inherited from ut::Non_copyable | |
Non_copyable (const Non_copyable &)=delete | |
Non_copyable & | operator= (const Non_copyable &)=delete |
Non_copyable ()=default | |
~Non_copyable ()=default | |
Captures ownership and manages lifetime of an already opened OS file descriptor.
Closes the file on object destruction.
|
default |
Default constructor, does not hold any file, does not close any on destruction.
|
inline |
Main constructor capturing an already opened OS file descriptor.
|
inline |
|
inline |
|
inline |
Closes the managed file.
Leaves the instance in the same state as default constructed instance.
|
inline |
Returns the managed OS file descriptor for use with OS functions that operate on file.
Do not close this file.
|
inline |
|
inline |
|
inline |
Swaps the underlying managed file descriptors between two instances of Unique_os_file_descriptor.
No files are closed.
|
private |