geopm
3.1.1.dev296+g5916b956
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 (int fd) | |
Main entry point: wrap a raw file descriptor. More... | |
UniqueFd (UniqueFd &&other) | |
Move constructor: make sure the source object no longer closes the wrapped fd. More... | |
~UniqueFd () | |
Close the wrapped fd if it is valid. More... | |
int | get () |
Get the wrapped raw fd (e.g., to call IO functions on it) More... | |
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 | ( | void | ) |
Get the wrapped raw fd (e.g., to call IO functions on it)