MAGE  v0.171.0
Matthias Advanced Game Engine
mage::CPUMonitor Class Reference

#include <cpu_monitor.hpp>

Public Member Functions

 CPUMonitor () noexcept=default
 
 CPUMonitor (const CPUMonitor &cpu_monitor) noexcept=default
 
 CPUMonitor (CPUMonitor &&cpu_monitor) noexcept=default
 
 ~CPUMonitor ()=default
 
CPUMonitoroperator= (const CPUMonitor &cpu_monitor) noexcept=default
 
CPUMonitoroperator= (CPUMonitor &&cpu_monitor) noexcept=default
 
void Start () noexcept
 
void Stop () noexcept
 
void Restart () noexcept
 
void Resume () noexcept
 
F64 GetCPUDeltaPercentage () noexcept
 
F64 GetTotalCPUDeltaPercentage () noexcept
 

Private Attributes

WallClockTimer m_wall_clock_timer
 
CPUTimer m_core_clock_timer
 

Detailed Description

A class of CPU monitors for monitoring CPU usage.

Constructor & Destructor Documentation

◆ CPUMonitor() [1/3]

mage::CPUMonitor::CPUMonitor ( )
defaultnoexcept

Constructs a CPU monitor.

◆ CPUMonitor() [2/3]

mage::CPUMonitor::CPUMonitor ( const CPUMonitor cpu_monitor)
defaultnoexcept

Constructs a CPU monitor from the given CPU monitor.

Parameters
[in]cpu_monitorA reference to the CPU monitor to copy.

◆ CPUMonitor() [3/3]

mage::CPUMonitor::CPUMonitor ( CPUMonitor &&  cpu_monitor)
defaultnoexcept

Constructs a CPU monitor by moving the given CPU monitor.

Parameters
[in]cpu_monitorA reference to the CPU monitor to move.

◆ ~CPUMonitor()

mage::CPUMonitor::~CPUMonitor ( )
default

Destructs this CPU monitor.

Member Function Documentation

◆ GetCPUDeltaPercentage()

F64 mage::CPUMonitor::GetCPUDeltaPercentage ( )
noexcept

Returns the CPU delta percentage of this CPU monitor's process.

Returns
The CPU delta percentage of this CPU monitor's process.

◆ GetTotalCPUDeltaPercentage()

F64 mage::CPUMonitor::GetTotalCPUDeltaPercentage ( )
noexcept

Returns the total CPU delta percentage of this CPU monitor's process.

Returns
The total CPU delta percentage of this CPU monitor's process.

◆ operator=() [1/2]

CPUMonitor& mage::CPUMonitor::operator= ( const CPUMonitor cpu_monitor)
defaultnoexcept

Copies the given CPU monitor to this CPU monitor.

Parameters
[in]cpu_monitorA reference to the CPU monitor to copy.
Returns
A reference to the copy of the given CPU monitor (i.e. this CPU monitor).

◆ operator=() [2/2]

CPUMonitor& mage::CPUMonitor::operator= ( CPUMonitor &&  cpu_monitor)
defaultnoexcept

Moves the given CPU monitor to this CPU monitor.

Parameters
[in]cpu_monitorA reference to the CPU monitor to move.
Returns
A reference to the moved CPU monitor (i.e. this CPU monitor).

◆ Restart()

void mage::CPUMonitor::Restart ( )
noexcept

Restarts this CPU monitor.

◆ Resume()

void mage::CPUMonitor::Resume ( )
noexcept

Resumes this CPU monitor.

◆ Start()

void mage::CPUMonitor::Start ( )
noexcept

Starts this CPU monitor.

◆ Stop()

void mage::CPUMonitor::Stop ( )
noexcept

Stops this CPU monitor.

Member Data Documentation

◆ m_core_clock_timer

CPUTimer mage::CPUMonitor::m_core_clock_timer
private

The core clock per core timer of this CPU monitor.

◆ m_wall_clock_timer

WallClockTimer mage::CPUMonitor::m_wall_clock_timer
private

The wall clock timer of this CPU monitor.