1 #ifndef GAUDIAUD_PROCSTATS_H 2 #define GAUDIAUD_PROCSTATS_H 10 #if defined( __linux__ ) or defined( __APPLE__ ) 13 #include <sys/types.h> 15 #endif // __linux__ or __APPLE__ 25 #pragma warning( push ) 26 #pragma warning( disable : 1572 ) 33 #pragma warning( pop ) 75 if ( m_fd != -1 ) ::close( m_fd );
78 explicit operator bool()
const {
return m_fd != -1; }
79 template <
typename... Args>
82 m_fd = ::open( std::forward<Args>(
args )... );
85 #define unique_fd_forward( fun ) \ 86 template <typename... Args> \ 87 auto fun( Args&&... args ) const->decltype(::fun( m_fd, std::forward<Args>( args )... ) ) \ 89 return ::fun( m_fd, std::forward<Args>( args )... ); \ 93 #undef unique_fd_forward 96 auto r = ::close( m_fd );
def read(f, regex='.*', skipevents=0)
bool operator==(const procInfo &p) const
unique_fd & open(Args &&...args)
PropertyMgr & operator=(const PropertyMgr &)=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)
#define unique_fd_forward(fun)