RumPi 1.0
A self-assembling C++ sensor & actuator library for the Raspberry Pi 5
RumPi.h
Go to the documentation of this file.
1#pragma once
2#include <string>
3#include <vector>
4#include "Common.h"
6#include "ComponentManager.h"
8
17namespace RumPi
18{
32 void Initialize();
33
50 void Start(bool runAndUpdateOnSeparateThread);
51
67 void Stop();
68
83 void AddComponent(BaseComponent* theComponent);
84
99
113 void UpdateComponents();
114
128 void UpdateComponentsOfType(const EComponentType typeOfComponentToUpdate);
129
145
164 bool GetComponentTypes(std::vector<EComponentType>& outComponentTypes);
165
178 std::string GetLogFilePath();
179
194 SelectedSensorReadings GetSelectedSensorReadings();
195} // namespace RumPi
RumPi is the library's top-level facade.
Definition: AlertManager.h:6
bool GetComponentTypes(std::vector< EComponentType > &outComponentTypes)
Fills the provided vector with the distinct component types the manager currently holds.
Definition: RumPi.cpp:341
void AddComponent(BaseComponent *theComponent)
Adds the provided component to the manager so it is polled and reported alongside the rest.
Definition: RumPi.cpp:226
void Stop()
Cleanly shuts down after a pull-based Start(false): wakes anything waiting, then tears down (turns co...
Definition: RumPi.cpp:190
EComponentType
Identifies each kind of component the library supports.
Definition: BaseComponent.h:14
SelectedSensorReadings GetSelectedSensorReadings()
Gets the curated set of current sensor readings for the Home dashboard, assembled by the ComponentMan...
Definition: RumPi.cpp:382
int GetNumberOfComponents()
Gets how many components the manager currently holds.
Definition: RumPi.cpp:247
std::string GetRawJsonDataFromComponentManager()
Gets every managed component's current readings as a JSON string, keyed by each component's unique na...
Definition: RumPi.cpp:313
void UpdateComponentsOfType(const EComponentType typeOfComponentToUpdate)
Polls just the components of one type, letting a pull-based consumer sample a fast sensor (e....
Definition: RumPi.cpp:291
void UpdateComponents()
Polls every managed component once, refreshing the values that GetRawJsonDataFromComponentManager() r...
Definition: RumPi.cpp:270
void Initialize()
Brings the library up: initializes the logger, loads and validates the configuration,...
Definition: RumPi.cpp:66
void Start(bool runAndUpdateOnSeparateThread)
Turns on every managed component.
Definition: RumPi.cpp:141
std::string GetLogFilePath()
Gets the path of the library's log file, so a client can reveal or open it without hardcoding the pat...
Definition: RumPi.cpp:363