![]() |
RumPi 1.0
A self-assembling C++ sensor & actuator library for the Raspberry Pi 5
|
Builds the sensor components described by a JSON manifest and adds them to a ComponentManager. More...
#include <ComponentFactory.h>
Static Public Member Functions | |
| static int | BuildComponents (ComponentManager &manager, const nlohmann::json &configJson, const RumPiConfig &config) |
| Reads the "components" array from an already-parsed config JSON and adds a live component to 'manager' for each entry. More... | |
Builds the sensor components described by a JSON manifest and adds them to a ComponentManager.
This is the single place that knows how to construct each concrete component from its manifest entry, so neither the rest of the library nor the client needs to 'new' a specific sensor by hand.
|
static |
Reads the "components" array from an already-parsed config JSON and adds a live component to 'manager' for each entry.
If the JSON has no "components" array, a built-in default manifest (the current robot) is used instead, so a usable set is always assembled. Individual bad entries are reported via AlertManager and skipped.
| [in,out] | manager | The component manager to add the built components to. |
| [in] | configJson | The parsed config JSON (its "components" array drives the build). |
| [in] | config | The loaded library configuration, passed to components that need it. |