11 #ifndef GAUDIAUD_PROCSTATS_H 12 #define GAUDIAUD_PROCSTATS_H 20 #if defined( __linux__ ) or defined( __APPLE__ ) 22 # include <sys/stat.h> 23 # include <sys/types.h> 25 #endif // __linux__ or __APPLE__ 34 # pragma warning( push ) 35 # pragma warning( disable : 1572 ) 42 # pragma warning( pop ) 83 explicit operator bool()
const {
return m_fd != -1; }
84 template <
typename... Args>
89 #define unique_fd_forward( fun ) \ 90 template <typename... Args> \ 91 auto fun( Args&&... args ) const->decltype( ::fun( m_fd, std::forward<Args>( args )... ) ) { \ 92 return ::fun( m_fd, std::forward<Args>( args )... ); \ 96 #undef unique_fd_forward 98 auto r = ::close(
m_fd );
unique_fd & operator=(const unique_fd &)=delete
bool operator==(const procInfo &p) const
static ProcStats * instance()
unique_fd & open(Args &&... args)
def read(f, regex='.*', skipevents=0)
unique_fd(const unique_fd &)=delete
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()
unique_fd(unique_fd &&other)
procInfo(double sz, double rss_sz)
bool fetch(procInfo &fill_me)