The Gaudi Framework  v36r10 (fc05264c)
ProcStats::unique_fd Class Reference

Public Member Functions

 unique_fd (const int fd=-1)
 
 unique_fd (unique_fd &&other)
 
 ~unique_fd ()
 
 operator bool () const
 
template<typename... Args>
unique_fdopen (Args &&... args)
 
int close ()
 

Private Member Functions

 unique_fd (const unique_fd &)=delete
 
unique_fdoperator= (const unique_fd &)=delete
 

Private Attributes

int m_fd { -1 }
 

Detailed Description

Definition at line 67 of file ProcStats.h.

Constructor & Destructor Documentation

◆ unique_fd() [1/3]

ProcStats::unique_fd::unique_fd ( const unique_fd )
privatedelete

◆ unique_fd() [2/3]

ProcStats::unique_fd::unique_fd ( const int  fd = -1)
inline

Definition at line 77 of file ProcStats.h.

77 : m_fd( fd ) {}

◆ unique_fd() [3/3]

ProcStats::unique_fd::unique_fd ( unique_fd &&  other)
inline

Definition at line 78 of file ProcStats.h.

78  {
79  m_fd = other.m_fd;
80  other.m_fd = -1;
81  }

◆ ~unique_fd()

ProcStats::unique_fd::~unique_fd ( )
inline

Definition at line 82 of file ProcStats.h.

82 { close(); }

Member Function Documentation

◆ close()

int ProcStats::unique_fd::close ( )
inline

Definition at line 91 of file ProcStats.h.

91  {
92  int r = 0;
93  if ( m_fd != -1 ) {
94  r = ::close( m_fd );
95  m_fd = -1;
96  }
97  return r;
98  }

◆ open()

template<typename... Args>
unique_fd& ProcStats::unique_fd::open ( Args &&...  args)
inline

Definition at line 87 of file ProcStats.h.

87  {
88  m_fd = ::open( std::forward<Args>( args )... );
89  return *this;
90  }

◆ operator bool()

ProcStats::unique_fd::operator bool ( ) const
inlineexplicit

Definition at line 85 of file ProcStats.h.

85 { return m_fd != -1; }

◆ operator=()

unique_fd& ProcStats::unique_fd::operator= ( const unique_fd )
privatedelete

Member Data Documentation

◆ m_fd

int ProcStats::unique_fd::m_fd { -1 }
private

Definition at line 70 of file ProcStats.h.


The documentation for this class was generated from the following file:
gaudirun.fd
fd
Definition: gaudirun.py:627
HistoDumpEx.r
r
Definition: HistoDumpEx.py:20
ProcStats::unique_fd::open
unique_fd & open(Args &&... args)
Definition: ProcStats.h:87
ProcStats::unique_fd::close
int close()
Definition: ProcStats.h:91
gaudirun.args
args
Definition: gaudirun.py:336
ProcStats::unique_fd::m_fd
int m_fd
Definition: ProcStats.h:70