xosview  1.23
About: xosview is an X Windows based system monitor (cpu, memory, swap and network usage; interrupt and serial activities; load average).
  Fossies Dox: xosview-1.23.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

CoreTemp Class Reference

#include <coretemp.h>

Inheritance diagram for CoreTemp:
[legend]
Collaboration diagram for CoreTemp:
[legend]

Public Member Functions

 CoreTemp (XOSView *parent, const char *label, const char *caption, int cpu)
 
 ~CoreTemp (void)
 
const char * name (void) const
 
void checkevent (void)
 
void checkResources (void)
 
 CoreTemp (XOSView *parent, const char *label, const char *caption, int pkg, int cpu)
 
 ~CoreTemp (void)
 
const char * name (void) const
 
void checkevent (void)
 
void checkResources (void)
 
- Public Member Functions inherited from FieldMeter
 FieldMeter (XOSView *parent, int numfields, const char *title="", const char *legend="", int docaptions=0, int dolegends=0, int dousedlegends=0)
 
virtual ~FieldMeter (void)
 
virtual void drawfields (int mandatory=0)
 
void setfieldcolor (int field, const char *color)
 
void setfieldcolor (int field, unsigned long color)
 
void docaptions (int val)
 
void dolegends (int val)
 
void dousedlegends (int val)
 
void reset (void)
 
void setUsed (double val, double total)
 
void draw (void)
 
void disableMeter (void)
 
- Public Member Functions inherited from Meter
 Meter (XOSView *parent, const char *title="", const char *legend="", int docaptions=0, int dolegends=0, int dousedlegends=0)
 
virtual ~Meter (void)
 
void resize (int x, int y, int width, int height)
 
void title (const char *title)
 
const char * title (void)
 
void legend (const char *legend)
 
const char * legend (void)
 
void docaptions (int val)
 
void dolegends (int val)
 
void dousedlegends (int val)
 
int requestevent (void)
 
int getX () const
 
int getY () const
 
int getWidth () const
 
int getHeight () const
 

Static Public Member Functions

static unsigned int countCpus (void)
 
static unsigned int countCores (unsigned int pkg)
 
static unsigned int countCpus (void)
 
- Static Public Member Functions inherited from Meter
static double scaleValue (double value, char *scale, bool metric)
 

Protected Member Functions

void getcoretemp (void)
 
void getcoretemp (void)
 
- Protected Member Functions inherited from FieldMeter
void SetUsedFormat (const char *const str)
 
void drawlegend (void)
 
void drawused (int mandatory)
 
bool checkX (int x, int width) const
 
void setNumFields (int n)
 
void IntervalTimerStart ()
 
void IntervalTimerStop ()
 
double IntervalTimeInMicrosecs ()
 
double IntervalTimeInSecs ()
 
- Protected Member Functions inherited from Meter
double samplesPerSecond ()
 
double secondsPerSample ()
 

Private Member Functions

void findSysFiles (void)
 

Private Attributes

int cpu_
 
int cpucount_
 
float high_
 
float * temps_
 
unsigned long actcolor_
 
unsigned long highcolor_
 
int _pkg
 
int _cpu
 
int _high
 
std::vector< std::string > _cpus
 
unsigned long _actcolor
 
unsigned long _highcolor
 

Additional Inherited Members

- Protected Types inherited from FieldMeter
enum  UsedType {
  INVALID_0 , FLOAT , PERCENT , AUTOSCALE ,
  INVALID_TAIL
}
 
- Protected Attributes inherited from FieldMeter
int numfields_
 
double * fields_
 
double total_
 
double used_
 
double lastused_
 
int * lastvals_
 
int * lastx_
 
unsigned long * colors_
 
unsigned long usedcolor_
 
UsedType print_
 
int printedZeroTotalMesg_
 
int numWarnings_
 
bool metric_
 
int usedoffset_
 
- Protected Attributes inherited from Meter
XOSViewparent_
 
int x_
 
int y_
 
int width_
 
int height_
 
int docaptions_
 
int dolegends_
 
int dousedlegends_
 
int priority_
 
int counter_
 
char * title_
 
char * legend_
 
unsigned long textcolor_
 

Detailed Description

Definition at line 19 of file coretemp.h.

Constructor & Destructor Documentation

◆ CoreTemp() [1/2]

CoreTemp::CoreTemp ( XOSView parent,
const char *  label,
const char *  caption,
int  cpu 
)

Definition at line 22 of file coretemp.cc.

References countCpus(), cpu_, cpucount_, FieldMeter::metric_, and temps_.

◆ ~CoreTemp() [1/2]

CoreTemp::~CoreTemp ( void  )

Definition at line 30 of file coretemp.cc.

References temps_.

◆ CoreTemp() [2/2]

CoreTemp::CoreTemp ( XOSView parent,
const char *  label,
const char *  caption,
int  pkg,
int  cpu 
)

Definition at line 33 of file coretemp.cc.

References _high, and FieldMeter::metric_.

◆ ~CoreTemp() [2/2]

CoreTemp::~CoreTemp ( void  )

Member Function Documentation

◆ checkevent() [1/2]

void CoreTemp::checkevent ( void  )
virtual

Implements Meter.

Definition at line 77 of file coretemp.cc.

References FieldMeter::drawfields(), and getcoretemp().

◆ checkevent() [2/2]

void CoreTemp::checkevent ( void  )
virtual

Reimplemented from FieldMeter.

◆ checkResources() [1/2]

◆ checkResources() [2/2]

void CoreTemp::checkResources ( void  )
virtual

Reimplemented from FieldMeter.

◆ countCores()

unsigned int CoreTemp::countCores ( unsigned int  pkg)
static

Definition at line 271 of file coretemp.cc.

References PATH_SIZE, SYS_CORETEMP, SYS_HWMON, and SYS_VIATEMP.

Referenced by findSysFiles().

◆ countCpus() [1/2]

unsigned int CoreTemp::countCpus ( void  )
static

Definition at line 73 of file coretemp.cc.

Referenced by CoreTemp(), and MeterMaker::makeMeters().

◆ countCpus() [2/2]

static unsigned int CoreTemp::countCpus ( void  )
static

◆ findSysFiles()

void CoreTemp::findSysFiles ( void  )
private

◆ getcoretemp() [1/2]

◆ getcoretemp() [2/2]

void CoreTemp::getcoretemp ( void  )
protected

◆ name() [1/2]

const char* CoreTemp::name ( void  ) const
inlinevirtual

Reimplemented from Meter.

Definition at line 24 of file coretemp.h.

Referenced by findSysFiles().

◆ name() [2/2]

const char* CoreTemp::name ( void  ) const
inlinevirtual

Reimplemented from Meter.

Definition at line 25 of file coretemp.h.

Member Data Documentation

◆ _actcolor

unsigned long CoreTemp::_actcolor
private

Definition at line 39 of file coretemp.h.

◆ _cpu

int CoreTemp::_cpu
private

Definition at line 37 of file coretemp.h.

Referenced by findSysFiles().

◆ _cpus

std::vector<std::string> CoreTemp::_cpus
private

Definition at line 38 of file coretemp.h.

Referenced by findSysFiles().

◆ _high

int CoreTemp::_high
private

Definition at line 37 of file coretemp.h.

Referenced by CoreTemp().

◆ _highcolor

unsigned long CoreTemp::_highcolor
private

Definition at line 39 of file coretemp.h.

◆ _pkg

int CoreTemp::_pkg
private

Definition at line 37 of file coretemp.h.

Referenced by findSysFiles().

◆ actcolor_

unsigned long CoreTemp::actcolor_
private

Definition at line 36 of file coretemp.h.

Referenced by checkResources(), and getcoretemp().

◆ cpu_

int CoreTemp::cpu_
private

Definition at line 34 of file coretemp.h.

Referenced by CoreTemp(), and getcoretemp().

◆ cpucount_

int CoreTemp::cpucount_
private

Definition at line 34 of file coretemp.h.

Referenced by checkResources(), CoreTemp(), and getcoretemp().

◆ high_

float CoreTemp::high_
private

Definition at line 35 of file coretemp.h.

Referenced by checkResources(), and getcoretemp().

◆ highcolor_

unsigned long CoreTemp::highcolor_
private

Definition at line 36 of file coretemp.h.

Referenced by checkResources(), and getcoretemp().

◆ temps_

float * CoreTemp::temps_
private

Definition at line 35 of file coretemp.h.

Referenced by checkResources(), CoreTemp(), getcoretemp(), and ~CoreTemp().


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