rtop
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
rtop::ProcViewPanel Class Reference

panel data structure responsible for displaying of property values for all live processes. More...

#include <panel2.h>

Inheritance diagram for rtop::ProcViewPanel:
rtop::SimplePanelData

Public Member Functions

 ProcViewPanel (int id)
 ProcViewPanel constructor. More...
 
void resolveKey (int) override
 resolve current key with panel's key dictionary More...
 
void show () override
 makes all columns associated with this panel visible More...
 
void hide () override
 hides all columns associated with this panel More...
 
void deleteColumn () override
 deletes Column based on item selected in active_proc_panel More...
 
void insertColumn () override
 inserts Column based on item selected in active_proc_panel More...
 
void moveLeft () override
 swaps column (based on selection in active_proc_panel) with left neighbour More...
 
void moveRight () override
 swaps column (based on selection in active_proc_panel) with left neighbour More...
 
void Down () override
 move cursor one position down More...
 
void Up () override
 move cursor one position up More...
 
void refresh () override
 manages column initialization and column updates More...
 
void setHeaderColor (int hcolor) override
 set column header color_pair More...
 
void syncColors () override
 
std::vector< std::string > displayedKeys () const
 called by Column::read. return vector of property names currently being displayed More...
 
std::string sortKey () const
 called by Column::read. returns property name to be used as sort key More...
 
- Public Member Functions inherited from rtop::SimplePanelData
 SimplePanelData (int)
 SimplePanelData constructor. More...
 
int uUid () const
 returns unique identifier of this object More...
 
void setWin (WINDOW *win_in)
 sets reference to ncurses WINDOW associated with panel More...
 
void setPanel (PANEL *panel_in)
 sets reference to ncurses PANEL associated with this panel data structure More...
 
void setDimensions (int h, int w)
 set internal width, height variables corresponding to panel window dimensions More...
 
void setLeftNbr (SimplePanelData *)
 set pointer to left neighbour panel More...
 
void setRightNbr (SimplePanelData *)
 set pointer to right neighbour panel More...
 
SimplePanelDataleftNbr ()
 returns pointer to left neighbour panel More...
 
SimplePanelDatarightNbr ()
 returns pointer to right neighbour panel More...
 
void moveTo (int, int)
 move panel window to desired x,y pos on stdscr. More...
 
virtual void show2 ()
 makes panel visible More...
 
WINDOW * window () const
 returns pointer to ncurses WINDOW associated with panel More...
 
virtual void selectionOn ()
 mock More...
 
virtual void selectionOff ()
 mock More...
 
virtual void toggleEditMode ()
 mock More...
 
virtual void editModeOn ()
 mock More...
 
virtual void editModeOff ()
 mock More...
 
virtual void setEditingColor (int)
 mock More...
 
virtual void setSelectionColor (int)
 mock More...
 
virtual void setBasicColor (int)
 mock More...
 
virtual void setHeader (std::string)
 mock More...
 
virtual void Top ()
 mock More...
 
virtual void refreshItemList ()
 mock More...
 
virtual void refreshItemList2 (std::vector< InfoProc< std::string >> &, std::string, const std::vector< int > &, int &)
 mock More...
 
virtual void moveIntoLeftNbr ()
 mock More...
 
virtual void moveIntoRightNbr ()
 mock More...
 
virtual void insertIntoLeftNbr ()
 mock More...
 
virtual void insertIntoRightNbr ()
 mock More...
 
virtual void addIntoLeftNbr ()
 mock More...
 
virtual void addIntoRightNbr ()
 mock More...
 
virtual void remove ()
 mock More...
 

Private Member Functions

void createColumn (EditPanelData< InfoProc< std::string >> &, int, int, std::string)
 responsible for creating a new edit panel containing menu to hold property values More...
 
void loadColumnsFromActiveProc ()
 runs only initially to create columns to load all properties to be displayed More...
 

Private Attributes

std::mutex clms_mutex
 
int browse_pos
 browser position in property column. 1 corresponds to 1st item More...
 
std::vector< EditPanelData< InfoProc< std::string > > > columns
 vector of EditPanel data structures, each containing list of specific propertie's value for all processes More...
 
ProcDbproc_database
 pointer reference to ProcDb object More...
 
std::string sort_key
 sorting key - some process's properties name More...
 
std::map< std::string, int > prop_wid_dict
 dictionary of column width assigned to each process property More...
 
std::vector< std::string > clm_names
 vector of property names currently being displayed by the panel More...
 
std::vector< int > clm_widths
 vector of column widths corresponding to properties being displayed More...
 
SimplePanelDataactive_proc_panel
 reference to panel data structure containing property names to be displayed. clm_names, clm_widths, columns remains in sync with item list in this panel More...
 
int y_start
 
int header_color
 color_pair corresponding to column headers More...
 

Friends

class XMLTree
 

Additional Inherited Members

- Protected Attributes inherited from rtop::SimplePanelData
int uuid
 
int width
 width and height in panel window in ncurses units. More...
 
int height
 
PANEL * panel
 panel to which the data structure is associated More...
 
WINDOW * win
 window attached to the panel More...
 
SimplePanelDatar_next
 pointer to panel data structures correponding to left/right neighbour of this panel More...
 
SimplePanelDatal_next
 
StateMachine smKeys
 Keys statemachine. More...
 

Detailed Description

panel data structure responsible for displaying of property values for all live processes.

responsible for deleting/adding/moving edit panels (referred internally as columns) corresponding to each property.
Also holds information for width, height and arrangement of property columns.

Definition at line 915 of file panel2.h.

Constructor & Destructor Documentation

◆ ProcViewPanel()

rtop::ProcViewPanel::ProcViewPanel ( int  id)
inline

ProcViewPanel constructor.

Definition at line 948 of file panel2.h.

Member Function Documentation

◆ createColumn()

void rtop::ProcViewPanel::createColumn ( EditPanelData< InfoProc< std::string >> &  panel_data,
int  width,
int  xpos,
std::string  header 
)
private

responsible for creating a new edit panel containing menu to hold property values

Todo:
: header color being set using hardcoded number. set properly.

Definition at line 1024 of file panel2.h.

◆ deleteColumn()

void rtop::ProcViewPanel::deleteColumn ( )
overridevirtual

deletes Column based on item selected in active_proc_panel

Reimplemented from rtop::SimplePanelData.

Definition at line 1082 of file panel2.h.

◆ displayedKeys()

std::vector< std::string > rtop::ProcViewPanel::displayedKeys ( ) const
virtual

called by Column::read. return vector of property names currently being displayed

Reimplemented from rtop::SimplePanelData.

Definition at line 996 of file panel2.h.

◆ Down()

void rtop::ProcViewPanel::Down ( )
overridevirtual

move cursor one position down

Reimplemented from rtop::SimplePanelData.

Definition at line 1215 of file panel2.h.

◆ hide()

void rtop::ProcViewPanel::hide ( )
overridevirtual

hides all columns associated with this panel

Reimplemented from rtop::SimplePanelData.

Definition at line 1072 of file panel2.h.

◆ insertColumn()

void rtop::ProcViewPanel::insertColumn ( )
overridevirtual

inserts Column based on item selected in active_proc_panel

Reimplemented from rtop::SimplePanelData.

Definition at line 1110 of file panel2.h.

◆ loadColumnsFromActiveProc()

void rtop::ProcViewPanel::loadColumnsFromActiveProc ( )
private

runs only initially to create columns to load all properties to be displayed

Definition at line 1040 of file panel2.h.

◆ moveLeft()

void rtop::ProcViewPanel::moveLeft ( )
overridevirtual

swaps column (based on selection in active_proc_panel) with left neighbour

Reimplemented from rtop::SimplePanelData.

Definition at line 1137 of file panel2.h.

◆ moveRight()

void rtop::ProcViewPanel::moveRight ( )
overridevirtual

swaps column (based on selection in active_proc_panel) with left neighbour

Reimplemented from rtop::SimplePanelData.

Definition at line 1175 of file panel2.h.

◆ refresh()

void rtop::ProcViewPanel::refresh ( )
overridevirtual

manages column initialization and column updates

Todo:
: no rationale for using mutex here. rationalize
Todo:
: no mutex to restrict access to clm_names. rationalize and implement

Reimplemented from rtop::SimplePanelData.

Definition at line 1255 of file panel2.h.

◆ resolveKey()

void rtop::ProcViewPanel::resolveKey ( int  ch)
overridevirtual

resolve current key with panel's key dictionary

Reimplemented from rtop::SimplePanelData.

Definition at line 1005 of file panel2.h.

◆ setHeaderColor()

void rtop::ProcViewPanel::setHeaderColor ( int  hcolor)
overridevirtual

set column header color_pair

Reimplemented from rtop::SimplePanelData.

Definition at line 987 of file panel2.h.

◆ show()

void rtop::ProcViewPanel::show ( )
overridevirtual

makes all columns associated with this panel visible

Reimplemented from rtop::SimplePanelData.

Definition at line 1062 of file panel2.h.

◆ sortKey()

std::string rtop::ProcViewPanel::sortKey ( ) const
inline

called by Column::read. returns property name to be used as sort key

Definition at line 982 of file panel2.h.

◆ syncColors()

void rtop::ProcViewPanel::syncColors ( )
overridevirtual
Todo:
: some bug is assigning header color to procviewpanel's columns. this function not doing its job. investigate

Reimplemented from rtop::SimplePanelData.

Definition at line 1014 of file panel2.h.

◆ Up()

void rtop::ProcViewPanel::Up ( )
overridevirtual

move cursor one position up

Reimplemented from rtop::SimplePanelData.

Definition at line 1236 of file panel2.h.

Friends And Related Function Documentation

◆ XMLTree

friend class XMLTree
friend

Definition at line 984 of file panel2.h.

Member Data Documentation

◆ active_proc_panel

SimplePanelData* rtop::ProcViewPanel::active_proc_panel
private

reference to panel data structure containing property names to be displayed. clm_names, clm_widths, columns remains in sync with item list in this panel

Definition at line 934 of file panel2.h.

◆ browse_pos

int rtop::ProcViewPanel::browse_pos
private

browser position in property column. 1 corresponds to 1st item

Definition at line 920 of file panel2.h.

◆ clm_names

std::vector<std::string> rtop::ProcViewPanel::clm_names
private

vector of property names currently being displayed by the panel

Definition at line 930 of file panel2.h.

◆ clm_widths

std::vector<int> rtop::ProcViewPanel::clm_widths
private

vector of column widths corresponding to properties being displayed

Definition at line 932 of file panel2.h.

◆ clms_mutex

std::mutex rtop::ProcViewPanel::clms_mutex
private

Definition at line 918 of file panel2.h.

◆ columns

std::vector<EditPanelData<InfoProc<std::string> > > rtop::ProcViewPanel::columns
private

vector of EditPanel data structures, each containing list of specific propertie's value for all processes

Definition at line 922 of file panel2.h.

◆ header_color

int rtop::ProcViewPanel::header_color
private

color_pair corresponding to column headers

Definition at line 938 of file panel2.h.

◆ proc_database

ProcDb* rtop::ProcViewPanel::proc_database
private

pointer reference to ProcDb object

Definition at line 924 of file panel2.h.

◆ prop_wid_dict

std::map<std::string, int> rtop::ProcViewPanel::prop_wid_dict
private

dictionary of column width assigned to each process property

Definition at line 928 of file panel2.h.

◆ sort_key

std::string rtop::ProcViewPanel::sort_key
private

sorting key - some process's properties name

Definition at line 926 of file panel2.h.

◆ y_start

int rtop::ProcViewPanel::y_start
private
Todo:
: not being used. make use of

Definition at line 936 of file panel2.h.


The documentation for this class was generated from the following file: