70 {
return _processInfo; }
75 inline const std::map<pid_t,ProcessTree> &
Children()
const
88 nlohmann::json ToJson()
const;
93 friend bool ToJson(
const ProcessTree & processTree, nlohmann::json & json);
97 std::map<pid_t,ProcessTree> _children;
101 std::ostream & Print(std::ostream & os, std::string indent)
const;
107 bool ToJson(
const ProcessTree & processTree, nlohmann::json & json);
Dwm::ProcessTable typedef and utility function prototypes.
std::map< pid_t, Dwm::ProcessInfo > ProcessTable
We represent a process table as a map of Dwm::Process keyed by process ID.
Definition DwmProcessTable.hh:55
Encapsulate information for a single process from the process table.
Definition DwmProcessInfo.hh:62
Encapsulates a process tree, i.e. a process and its descendants.
Definition DwmProcessTree.hh:50
ProcessTree(pid_t pid)
Create a process tree rooted at the given process ID pid.
const ProcessInfo & ProcInfo() const
Returns the process info for the process.
Definition DwmProcessTree.hh:69
ProcessTree()=default
Defaulted constructors and assignment operators.
friend std::ostream & operator<<(std::ostream &os, const ProcessTree &pt)
Prints the process tree to an ostream.
const std::map< pid_t, ProcessTree > & Children() const
Returns the children of the process.
Definition DwmProcessTree.hh:75