214 const std::string&
GetName()
const;
229 void SetName(
const std::string& name);
Abstract base class for every component (sensor, actuator, etc.) the library manages.
Definition: BaseComponent.h:60
virtual ~BaseComponent()
Virtual destructor so deleting a component through a BaseComponent* also cleans up the concrete subcl...
Definition: BaseComponent.cpp:34
virtual void ProcessRawValues()=0
Reads and processes the component's latest raw values (called once per poll).
virtual std::string ToString() const =0
Serializes the component's current readings to a string (usually JSON).
BaseComponent()
Builds a base component with an unknown type and an empty name.
Definition: BaseComponent.cpp:17
const std::string & GetName() const
Gets the component's unique per-instance name.
Definition: BaseComponent.cpp:260
std::string myName
A unique per-instance name, assigned when the component is added to the manager.
Definition: BaseComponent.h:67
static std::string ComponentTypeToString(const EComponentType theComponentTypeToConvert)
Maps an EComponentType to its string name.
Definition: BaseComponent.cpp:54
static EComponentType StringToComponentType(const std::string &theComponentTypeName)
Maps a type name back to its EComponentType (the inverse of ComponentTypeToString),...
Definition: BaseComponent.cpp:209
EComponentType myComponentType
The kind of component this is (set by each concrete subclass).
Definition: BaseComponent.h:63
virtual void TurnOff()=0
Turns the component off.
virtual EComponentType GetComponentType() const
Gets the component's type.
Definition: BaseComponent.cpp:243
void SetName(const std::string &name)
Sets the component's unique per-instance name.
Definition: BaseComponent.cpp:278
virtual void TurnOn()=0
Turns the component on (e.g.
RumPi is the library's top-level facade.
Definition: AlertManager.h:6
EComponentType
Identifies each kind of component the library supports.
Definition: BaseComponent.h:14
@ E_SystemHealthComponent