The Gaudi Framework  v36r9 (fd2bdac3)
ProcStats::unique_fd Class Reference

Public Member Functions

 unique_fd (int fd=-1)
 
 unique_fd (unique_fd &&other)
 
 ~unique_fd ()
 
 operator bool () const
 
template<typename... Args>
unique_fdopen (Args &&... args)
 
 unique_fd_forward (lseek) unique_fd_forward(read) unique_fd_forward(write) unique_fd_forward(fcntl) unique_fd_forward(fsync) unique_fd_forward(fchown) unique_fd_forward(stat) int close()
 

Private Member Functions

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

Private Attributes

int m_fd
 

Detailed Description

Definition at line 68 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 ( int  fd = -1)
inline

Definition at line 74 of file ProcStats.h.

74 : m_fd( fd ) {}

◆ unique_fd() [3/3]

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

Definition at line 75 of file ProcStats.h.

75  {
76  m_fd = other.m_fd;
77  other.m_fd = -1;
78  }

◆ ~unique_fd()

ProcStats::unique_fd::~unique_fd ( )
inline

Definition at line 79 of file ProcStats.h.

79  {
80  if ( m_fd != -1 ) ::close( m_fd );
81  }

Member Function Documentation

◆ open()

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

Definition at line 85 of file ProcStats.h.

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

◆ operator bool()

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

Definition at line 83 of file ProcStats.h.

83 { return m_fd != -1; }

◆ operator=()

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

◆ unique_fd_forward()

ProcStats::unique_fd::unique_fd_forward ( lseek  )
inline

Definition at line 94 of file ProcStats.h.

97  {
98  auto r = ::close( m_fd );
99  m_fd = -1;
100  return r;
101  }

Member Data Documentation

◆ m_fd

int ProcStats::unique_fd::m_fd
private

Definition at line 69 of file ProcStats.h.


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