|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Example demonstrating both legacy and modern use of Event Tables. More...
Go to the source code of this file.
Classes | |
| struct | SmartHomeState |
| struct | ModernSmartHome |
Functions | |
| void * | on_lights_on (void *data) |
| void * | on_lights_off (void *data) |
| void * | on_temp_up (void *data) |
| void * | on_arm_alarm (void *data) |
| void * | on_panic (void *data) |
| void | run_legacy_example () |
| void | run_modern_example () |
| int | main () |
Example demonstrating both legacy and modern use of Event Tables.
This example simulates a simple "Smart Home" system where different devices (Lights, Thermostat, Security System) respond to events.
It demonstrates:
Definition in file driven_table_example.C.
| int main | ( | ) |
Definition at line 302 of file driven_table_example.C.
References Aleph::maps(), run_legacy_example(), and run_modern_example().
| void * on_arm_alarm | ( | void * | data | ) |
Definition at line 108 of file driven_table_example.C.
References SmartHomeState::alarm_armed.
Referenced by run_legacy_example().
| void * on_lights_off | ( | void * | data | ) |
Definition at line 90 of file driven_table_example.C.
References SmartHomeState::lights_on.
Referenced by run_legacy_example().
| void * on_lights_on | ( | void * | data | ) |
Definition at line 81 of file driven_table_example.C.
References SmartHomeState::lights_on.
Referenced by run_legacy_example().
| void * on_panic | ( | void * | data | ) |
Definition at line 117 of file driven_table_example.C.
References SmartHomeState::lights_on.
Referenced by run_legacy_example().
| void * on_temp_up | ( | void * | data | ) |
Definition at line 99 of file driven_table_example.C.
References SmartHomeState::temperature, and Aleph::to_string().
Referenced by run_legacy_example().
| void run_legacy_example | ( | ) |
Definition at line 130 of file driven_table_example.C.
References Aleph::maps(), on_arm_alarm(), on_lights_off(), on_lights_on(), on_panic(), on_temp_up(), and Aleph::HTList::size().
Referenced by main().
| void run_modern_example | ( | ) |
Definition at line 203 of file driven_table_example.C.
References h, Aleph::maps(), and Aleph::to_string().
Referenced by main().