7 #include <unordered_set> 15 extern src::severity_logger<severity_level>
lg;
33 Info(std::string hdr, std::string short_desc, std::string long_desc)
41 Info(std::string hdr, std::string short_desc, std::string long_desc, std::string unit_str)
70 template <
class T=
int>
105 return (std::stoi(a.
val) <= std::stoi(b.
val));
115 std::map<std::string, std::vector<InfoProc<std::string>>>
database;
std::string shortdesc
string representation of value
bool operator<=(const InfoProc< std::string > &a, const InfoProc< std::string > &b)
overloaded <= operator for comparing two InfoProc objects
Info(std::string hdr, std::string short_desc, std::string long_desc)
friend bool operator<=(const InfoProc< std::string > &, const InfoProc< std::string > &)
overloaded <= operator for comparing two InfoProc objects
int dbsize
size of property vector i.e. number of processes whose properties are being maintained
ProcDb(int id)
ProcDb constructor. Instantiates object with provided unique identifier.
const char * shortDesc()
returns c-string corresponding to stored value. wasteful, as performs conversion everytime
Info(std::string hdr, std::string short_desc, std::string long_desc, std::string unit_str)
data structure that hold property values for processes. contains facilities to enable their proper ac...
void setVal(T v)
sets value
std::vector< int > sorted_indices
vector that holds the permutation order to parse property vectors in sorted order
panel data structure responsible for displaying of property values for all live processes.
friend std::ostream & operator<<(std::ostream &, const InfoProc< J > &)
std::map< std::string, std::vector< InfoProc< std::string > > > database
dictionary that holds vector of values corresponding to each property name string
data structure that defines type of entry from which panel menu entrires obtain their c-string data
std::map< int, std::pair< std::string, std::string > > field_prop_dict
dictionary that holds property locations in /proc/pid/stat file, and correspondingg prop name and typ...
src::severity_logger< severity_level > lg
std::map< std::string, std::string > prop_type_dict
dictionary hold property name and corresponding type
enables indentation of logs for easy viewing
data structure that defines type of entry from which panel menu entries obtain their c-string data
InfoProc(T v)
InfoProc constructor. Initializes InfoProc with provided value.
interfaces with linux API to read process information and update ProcDb with it
std::string header
header, longdesc and shortdesc of a panel entry
T Val()
returns stored value