NDEVR
API Documentation
BatteryAlertWatcher

Listens for changes to a Battery and reports an error to the user when thresholds are crossed. More...

Collaboration diagram for BatteryAlertWatcher:
[legend]

Public Member Functions

void addLocalBatteries ()
 Adds all locally detected batteries to the watch list.
void addSensors (const Buffer< Battery * > &sensors)
 Adds battery sensors to be monitored for threshold alerts.
void removeSensors (const Buffer< Battery * > &sensors)
 Removes battery sensors from monitoring.

Static Public Member Functions

static BatteryAlertWatcherDefault ()
 Returns the singleton default BatteryAlertWatcher instance.

Protected Member Functions

void stateChangeSlot (bool originator)
 Slot called when a battery state changes.

Protected Attributes

Dictionary< UUID, QPointer< Battery > > m_sensors
 Map of monitored battery sensors keyed by UUID.

Detailed Description

Listens for changes to a Battery and reports an error to the user when thresholds are crossed.


Definition at line 49 of file BatteryWidget.h.

Member Function Documentation

◆ addSensors()

void BatteryAlertWatcher::addSensors ( const Buffer< Battery * > & sensors)

Adds battery sensors to be monitored for threshold alerts.

Parameters
[in]sensorsThe batteries to watch.

◆ Default()

BatteryAlertWatcher & BatteryAlertWatcher::Default ( )
static

Returns the singleton default BatteryAlertWatcher instance.

Returns
Reference to the global BatteryAlertWatcher.

◆ removeSensors()

void BatteryAlertWatcher::removeSensors ( const Buffer< Battery * > & sensors)

Removes battery sensors from monitoring.

Parameters
[in]sensorsThe batteries to stop watching.

◆ stateChangeSlot()

void BatteryAlertWatcher::stateChangeSlot ( bool originator)
protected

Slot called when a battery state changes.

Parameters
[in]originatorWhether this instance originated the change.

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