#include <main_loop.h>
Public Member Functions | |
MainLoop () | |
constructor initializing the MainLoop object | |
void | run () |
runs the main loop | |
void | quit () |
quits the main loop | |
void | updateCallbacks () |
updates all callbacks within the main loop | |
int | addCallback (int interval, gboolean(*function)(gpointer data)) |
adds a callback to the main loop | |
Private Member Functions | |
void | setupCallbacks () |
adds callbacks to the main loop | |
Static Private Member Functions | |
static gboolean | hwEvent_callback (GIOChannel *io_channel, GIOCondition io_condition, gpointer data) |
callback for events on acpi/apm event file | |
static gboolean | hwEvent_reconnect (gpointer data) |
callback for reconnection to the hwEvent channel | |
static gboolean | hwEvent_connect () |
connects to the hw event file (apm/acpi) | |
static gboolean | checkThrottling_callback (gpointer data) |
callback for updating the cpu state inside PM_interface | |
static gboolean | checkEventTimeouts_callback (gpointer data) |
callback for checking pending powersave events | |
static gboolean | adjustSpeeds_callback (gpointer data) |
callback for adjust cpu speed in case of cpufreq userspace | |
Private Attributes | |
GMainLoop * | _gmain |
gmain loop object | |
std::list< Callback > | _callback_functions |
list storing all added callbacks | |
DBus_Server | _dbus_server |
Cares about callbacks and executes appropriate functions from PM_Interface
|
constructor initializing the MainLoop object Constructor setting up the dbus connection and the gmain loop. For running the main loop, you have to call run(). |
|
adds a callback to the main loop adds a callback function with the given interval to the gmain loop
|
|
callback for adjust cpu speed in case of cpufreq userspace calls CPUFreq::adjustSpeeds If cpu, function returns false is not called again
|
|
callback for checking pending powersave events calls pm->checkEventTimeouts();
|
|
callback for updating the cpu state inside PM_interface calls pm->updateCPUState();
|
|
callback for events on acpi/apm event file Function is called whenever there is an event on the hw event filedescriptor. Defined static to be used as gmain loop callback
|
|
connects to the hw event file (apm/acpi) Function is called successively when hw event channel broke away. Defined static to be used inside static callback functions.
|
|
callback for reconnection to the hwEvent channel Function is called successively when hw event channel broke away until it is back again.. Defined static to be used as gmain loop callback
|
|
quits the main loop
|
|
runs the main loop Runs the main loop and blocks until quit() is called. |
|
adds callbacks to the main loop Adds the default callbacks to the main loop. |
|
updates all callbacks within the main loop Updates all callbacks within the main loop. If a callback already exists, do nothing. This function should be called whenever there is a config/scheme/hardware change. It needs less ressources, so it is no problem to call it as often as needed. |
|
list storing all added callbacks
|
|
|
|
gmain loop object
|