13 #ifndef __STOUT_OS_PROCESS_HPP__
14 #define __STOUT_OS_PROCESS_HPP__
16 #include <sys/types.h>
41 const std::string& _command,
98 return find(pid).isSome();
120 const std::list<ProcessTree>& _children)
144 std::ostringstream out;
164 std::ostringstream out;
165 out <<
"[ " << std::endl;
166 std::list<os::ProcessTree>::const_iterator iterator = list.begin();
167 while (iterator != list.end()) {
169 if (++iterator != list.end()) {
170 out << std::endl << std::endl;
173 out << std::endl <<
"]";
177 #endif // __STOUT_OS_PROCESS_HPP__
Try< Bytes > size(const std::string &path, const FollowSymlink follow=FollowSymlink::FOLLOW_SYMLINK)
Definition: stat.hpp:100
const std::list< ProcessTree > children
Definition: process.hpp:112
bool contains(pid_t pid) const
Definition: process.hpp:96
const Process process
Definition: process.hpp:111
const pid_t group
Definition: process.hpp:55
bool operator!=(const Process &p) const
Definition: process.hpp:70
const Option< Bytes > rss
Definition: process.hpp:57
const Option< pid_t > session
Definition: process.hpp:56
bool isSome() const
Definition: option.hpp:115
friend Try< ProcessTree > pstree(pid_t, const std::list< Process > &)
Definition: pstree.hpp:37
DWORD pid_t
Definition: windows.hpp:187
Definition: process.hpp:32
const pid_t pid
Definition: process.hpp:53
const bool zombie
Definition: process.hpp:61
bool operator>=(const Process &p) const
Definition: process.hpp:68
Option< ProcessTree > find(pid_t pid) const
Definition: process.hpp:79
const Option< Duration > utime
Definition: process.hpp:58
std::string replace(const std::string &s, const std::string &from, const std::string &to)
Definition: strings.hpp:112
bool operator<(const Process &p) const
Definition: process.hpp:65
Try< std::vector< Entry > > list(const std::string &hierarchy, const std::string &cgroup)
bool operator<=(const Process &p) const
Definition: process.hpp:66
const pid_t parent
Definition: process.hpp:54
const std::string command
Definition: process.hpp:60
bool operator>(const Process &p) const
Definition: process.hpp:67
const Option< Duration > stime
Definition: process.hpp:59
std::ostream & operator<<(std::ostream &stream, const ProcessTree &tree)
Definition: process.hpp:126
bool operator==(const Process &p) const
Definition: process.hpp:69
std::string stringify(int flags)
Definition: process.hpp:74
Process(pid_t _pid, pid_t _parent, pid_t _group, const Option< pid_t > &_session, const Option< Bytes > &_rss, const Option< Duration > &_utime, const Option< Duration > &_stime, const std::string &_command, bool _zombie)
Definition: process.hpp:34