|
geopm 3.2.1.dev237+gbe30cff60
GEOPM - Global Extensible Open Power Manager
|
A wrapper to close a file descriptor when the descriptor goes out of scope. More...
#include <UniqueFd.hpp>
Public Member Functions | |
| UniqueFd ()=delete | |
| UniqueFd (UniqueFd const &)=delete | |
| UniqueFd & | operator= (UniqueFd const &)=delete |
| UniqueFd & | operator= (UniqueFd &&other)=delete |
| UniqueFd (int fd) | |
| Main entry point: wrap a raw file descriptor. | |
| UniqueFd (UniqueFd &&other) | |
| Move constructor: make sure the source object no longer closes the wrapped fd. | |
| ~UniqueFd () | |
| Close the wrapped fd if it is valid. | |
| int | get () |
| Get the wrapped raw fd (e.g., to call IO functions on it) | |
A wrapper to close a file descriptor when the descriptor goes out of scope.
|
delete |
|
delete |
| geopm::UniqueFd::UniqueFd | ( | int | fd | ) |
Main entry point: wrap a raw file descriptor.
| geopm::UniqueFd::UniqueFd | ( | UniqueFd && | other | ) |
Move constructor: make sure the source object no longer closes the wrapped fd.
| geopm::UniqueFd::~UniqueFd | ( | ) |
Close the wrapped fd if it is valid.
| int geopm::UniqueFd::get | ( | ) |
Get the wrapped raw fd (e.g., to call IO functions on it)