1 #ifndef GAUDIAUD_PROCSTATS_H 2 #define GAUDIAUD_PROCSTATS_H 10 #if defined( __linux__ ) or defined( __APPLE__ ) 12 # include <sys/stat.h> 13 # include <sys/types.h> 15 #endif // __linux__ or __APPLE__ 24 # pragma warning( push ) 25 # pragma warning( disable : 1572 ) 32 # pragma warning( pop ) 73 explicit operator bool()
const {
return m_fd != -1; }
74 template <
typename... Args>
79 #define unique_fd_forward( fun ) \ 80 template <typename... Args> \ 81 auto fun( Args&&... args ) const->decltype( ::fun( m_fd, std::forward<Args>( args )... ) ) { \ 82 return ::fun( m_fd, std::forward<Args>( args )... ); \ 86 #undef unique_fd_forward 88 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)