geopm  3.1.1.dev296+g5916b956
GEOPM - Global Extensible Open Power Manager
Public Member Functions | List of all members
geopm::UniqueFd Class Reference

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
 
UniqueFdoperator= (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...
 

Detailed Description

A wrapper to close a file descriptor when the descriptor goes out of scope.

Constructor & Destructor Documentation

◆ UniqueFd() [1/4]

geopm::UniqueFd::UniqueFd ( )
delete

◆ UniqueFd() [2/4]

geopm::UniqueFd::UniqueFd ( UniqueFd const &  )
delete

◆ UniqueFd() [3/4]

geopm::UniqueFd::UniqueFd ( int  fd)

Main entry point: wrap a raw file descriptor.

◆ UniqueFd() [4/4]

geopm::UniqueFd::UniqueFd ( UniqueFd &&  other)

Move constructor: make sure the source object no longer closes the wrapped fd.

◆ ~UniqueFd()

geopm::UniqueFd::~UniqueFd ( )

Close the wrapped fd if it is valid.

Member Function Documentation

◆ get()

int geopm::UniqueFd::get ( void  )

Get the wrapped raw fd (e.g., to call IO functions on it)

◆ operator=()

UniqueFd& geopm::UniqueFd::operator= ( UniqueFd const &  )
delete

The documentation for this class was generated from the following files: