|
Icarus
Vehicle Simulation as a Transformable Computational Graph, built on Vulcan and Janus
|
Factory for creating components from configuration. More...
#include <icarus/core/Component.hpp>#include <icarus/core/ComponentConfig.hpp>#include <icarus/core/Error.hpp>#include <janus/core/JanusTypes.hpp>#include <functional>#include <memory>#include <string>#include <unordered_map>#include <vector>

Go to the source code of this file.
Classes | |
| class | icarus::ComponentFactory< Scalar > |
| Factory for creating components from configuration. More... | |
Namespaces | |
| namespace | icarus |
Macros | |
| #define | ICARUS_REGISTER_COMPONENT(ComponentType) |
| Register a component type with the factory (both backends). | |
| #define | ICARUS_REGISTER_COMPONENT_IMPL2(ComponentType, TypeName, Counter) |
| Register component with custom type name (both backends). | |
| #define | ICARUS_REGISTER_COMPONENT_IMPL(ComponentType, TypeName, Counter) |
| #define | ICARUS_REGISTER_COMPONENT_AS(ComponentType, TypeName) |
| #define | ICARUS_REGISTER_COMPONENT_WITH_CREATOR_IMPL2(TypeName, CreatorLambda, Counter) |
| Register component with custom creator function (numeric backend only). | |
| #define | ICARUS_REGISTER_COMPONENT_WITH_CREATOR_IMPL(TypeName, CreatorLambda, Counter) |
| #define | ICARUS_REGISTER_COMPONENT_WITH_CREATOR(TypeName, CreatorLambda) |
Factory for creating components from configuration.
Part of Phase 4.0.7: Configuration Infrastructure. Provides a singleton factory with component registration.
Updated to pass full ComponentConfig to creators, enabling components to read their scalars, vectors, and other configuration values.
| #define ICARUS_REGISTER_COMPONENT | ( | ComponentType | ) |
Register a component type with the factory (both backends).
The component class must have a constructor that accepts (name, entity): ComponentType(std::string name, std::string entity)
The factory will call SetConfig() after construction. Components read their configuration in Stage() via GetConfig().
Registers with both janus::NumericScalar (double) and janus::SymbolicScalar (casadi::MX) backends for full dual-backend support.
Usage in component header or cpp file (namespace scope):
| #define ICARUS_REGISTER_COMPONENT_AS | ( | ComponentType, | |
| TypeName ) |
| #define ICARUS_REGISTER_COMPONENT_IMPL | ( | ComponentType, | |
| TypeName, | |||
| Counter ) |
| #define ICARUS_REGISTER_COMPONENT_IMPL2 | ( | ComponentType, | |
| TypeName, | |||
| Counter ) |
Register component with custom type name (both backends).
Registers with both janus::NumericScalar and janus::SymbolicScalar backends.
Usage (at namespace scope, inside the component's namespace):
| #define ICARUS_REGISTER_COMPONENT_WITH_CREATOR | ( | TypeName, | |
| CreatorLambda ) |
| #define ICARUS_REGISTER_COMPONENT_WITH_CREATOR_IMPL | ( | TypeName, | |
| CreatorLambda, | |||
| Counter ) |
| #define ICARUS_REGISTER_COMPONENT_WITH_CREATOR_IMPL2 | ( | TypeName, | |
| CreatorLambda, | |||
| Counter ) |
Register component with custom creator function (numeric backend only).
Use when component needs special construction logic. The creator lambda is responsible for calling SetConfig() on the component.
Note: This macro only registers with janus::NumericScalar. For dual-backend support with custom creators, use the factory directly.
Usage: