Configuration container for components.
More...
#include <ComponentConfig.hpp>
|
| template<typename T> |
| T | Require (const std::string &key) const |
| | Get a required config value (throws if missing).
|
| template<typename T> |
| T | Get (const std::string &key, const T &default_value) const |
| | Get an optional config value with default.
|
| template<typename T> |
| bool | Has (const std::string &key) const |
| | Check if a key exists.
|
| std::string | FullPath () const |
| | Get the full component path: entity.name (or just name if no entity).
|
| template<> |
| double | Get (const std::string &key, const double &def) const |
| template<> |
| double | Require (const std::string &key) const |
| template<> |
| bool | Has (const std::string &key) const |
| template<> |
| int | Get (const std::string &key, const int &def) const |
| template<> |
| int | Require (const std::string &key) const |
| template<> |
| bool | Has (const std::string &key) const |
| template<> |
| int64_t | Get (const std::string &key, const int64_t &def) const |
| template<> |
| int64_t | Require (const std::string &key) const |
| template<> |
| bool | Has (const std::string &key) const |
| template<> |
| bool | Get (const std::string &key, const bool &def) const |
| template<> |
| bool | Require (const std::string &key) const |
| template<> |
| bool | Has (const std::string &key) const |
| template<> |
| Vec3< double > | Get (const std::string &key, const Vec3< double > &def) const |
| template<> |
| Vec3< double > | Require (const std::string &key) const |
| template<> |
| bool | Has (const std::string &key) const |
| template<> |
| Vec4< double > | Get (const std::string &key, const Vec4< double > &def) const |
| template<> |
| Vec4< double > | Require (const std::string &key) const |
| template<> |
| bool | Has (const std::string &key) const |
|
| std::string | name |
| | Component instance name.
|
| std::string | entity |
| | Entity namespace (optional).
|
| std::string | type |
| | Component type name.
|
| std::unordered_map< std::string, double > | scalars |
| std::unordered_map< std::string, std::vector< double > > | vectors |
| | Vec3 stored as [x,y,z].
|
| std::unordered_map< std::string, std::vector< double > > | arrays |
| std::unordered_map< std::string, std::string > | strings |
| std::unordered_map< std::string, int64_t > | integers |
| std::unordered_map< std::string, bool > | booleans |
| std::vector< std::string > | sources |
| | List-based config (for aggregators with variable source counts, etc.).
|
| std::vector< std::string > | body_sources |
| | Frame-categorized source lists (for ForceAggregator frame transformations).
|
| std::vector< std::string > | ecef_sources |
| | Sources outputting in ECEF frame.
|
Configuration container for components.
Passed to Provision() and Stage(). Components request values using typed accessors. This is the ONLY way to configure a component beyond the constructor (which only takes name/entity).
Example usage in Provision():
mass_ = cfg.
Require<
double>(
"mass");
cd_ = cfg.
Get<
double>(
"drag_coefficient", 0.5);
position_ = cfg.
Get<Vec3<double>>(
"initial_position", Vec3<double>::Zero());
}
Component-facing facade for signal registration and resolution.
Definition Backplane.hpp:32
@ Provision
Definition Error.hpp:231
Configuration container for components.
Definition ComponentConfig.hpp:37
T Get(const std::string &key, const T &default_value) const
Get an optional config value with default.
T Require(const std::string &key) const
Get a required config value (throws if missing).
◆ FullPath()
| std::string icarus::ComponentConfig::FullPath |
( |
| ) |
const |
|
inlinenodiscard |
Get the full component path: entity.name (or just name if no entity).
◆ Get() [1/7]
template<>
| bool icarus::ComponentConfig::Get |
( |
const std::string & | key, |
|
|
const bool & | def ) const |
|
inline |
◆ Get() [2/7]
template<>
| double icarus::ComponentConfig::Get |
( |
const std::string & | key, |
|
|
const double & | def ) const |
|
inline |
◆ Get() [3/7]
template<>
| int icarus::ComponentConfig::Get |
( |
const std::string & | key, |
|
|
const int & | def ) const |
|
inline |
◆ Get() [4/7]
template<>
| int64_t icarus::ComponentConfig::Get |
( |
const std::string & | key, |
|
|
const int64_t & | def ) const |
|
inline |
◆ Get() [5/7]
template<typename T>
| T icarus::ComponentConfig::Get |
( |
const std::string & | key, |
|
|
const T & | default_value ) const |
Get an optional config value with default.
- Template Parameters
-
- Parameters
-
| key | Configuration key |
| default_value | Value to return if key is missing |
- Returns
- Value of type T, or default_value if missing
◆ Get() [6/7]
template<>
| Vec3< double > icarus::ComponentConfig::Get |
( |
const std::string & | key, |
|
|
const Vec3< double > & | def ) const |
|
inline |
◆ Get() [7/7]
template<>
| Vec4< double > icarus::ComponentConfig::Get |
( |
const std::string & | key, |
|
|
const Vec4< double > & | def ) const |
|
inline |
◆ Has() [1/7]
template<>
| bool icarus::ComponentConfig::Has |
( |
const std::string & | key | ) |
const |
|
inline |
◆ Has() [2/7]
template<>
| bool icarus::ComponentConfig::Has |
( |
const std::string & | key | ) |
const |
|
inline |
◆ Has() [3/7]
template<>
| bool icarus::ComponentConfig::Has |
( |
const std::string & | key | ) |
const |
|
inline |
◆ Has() [4/7]
template<>
| bool icarus::ComponentConfig::Has |
( |
const std::string & | key | ) |
const |
|
inline |
◆ Has() [5/7]
template<>
| bool icarus::ComponentConfig::Has |
( |
const std::string & | key | ) |
const |
|
inline |
◆ Has() [6/7]
template<>
| bool icarus::ComponentConfig::Has |
( |
const std::string & | key | ) |
const |
|
inline |
◆ Has() [7/7]
template<typename T>
| bool icarus::ComponentConfig::Has |
( |
const std::string & | key | ) |
const |
|
nodiscard |
Check if a key exists.
- Template Parameters
-
| T | Value type (determines which storage to check) |
- Parameters
-
- Returns
- True if key exists in appropriate storage
◆ Require() [1/7]
template<>
| Vec4< double > icarus::ComponentConfig::Require |
( |
const std::string & | key | ) |
const |
|
inline |
◆ Require() [2/7]
template<>
| Vec3< double > icarus::ComponentConfig::Require |
( |
const std::string & | key | ) |
const |
|
inline |
◆ Require() [3/7]
template<>
| bool icarus::ComponentConfig::Require |
( |
const std::string & | key | ) |
const |
|
inline |
◆ Require() [4/7]
template<>
| int64_t icarus::ComponentConfig::Require |
( |
const std::string & | key | ) |
const |
|
inline |
◆ Require() [5/7]
template<>
| int icarus::ComponentConfig::Require |
( |
const std::string & | key | ) |
const |
|
inline |
◆ Require() [6/7]
template<>
| double icarus::ComponentConfig::Require |
( |
const std::string & | key | ) |
const |
|
inline |
◆ Require() [7/7]
template<typename T>
| T icarus::ComponentConfig::Require |
( |
const std::string & | key | ) |
const |
Get a required config value (throws if missing).
- Template Parameters
-
- Parameters
-
- Returns
- Value of type T
- Exceptions
-
◆ arrays
| std::unordered_map<std::string, std::vector<double> > icarus::ComponentConfig::arrays |
◆ body_sources
| std::vector<std::string> icarus::ComponentConfig::body_sources |
Frame-categorized source lists (for ForceAggregator frame transformations).
Sources outputting in body frame
◆ booleans
| std::unordered_map<std::string, bool> icarus::ComponentConfig::booleans |
◆ ecef_sources
| std::vector<std::string> icarus::ComponentConfig::ecef_sources |
Sources outputting in ECEF frame.
◆ entity
| std::string icarus::ComponentConfig::entity |
Entity namespace (optional).
◆ integers
| std::unordered_map<std::string, int64_t> icarus::ComponentConfig::integers |
◆ name
| std::string icarus::ComponentConfig::name |
◆ scalars
| std::unordered_map<std::string, double> icarus::ComponentConfig::scalars |
◆ sources
| std::vector<std::string> icarus::ComponentConfig::sources |
List-based config (for aggregators with variable source counts, etc.).
◆ strings
| std::unordered_map<std::string, std::string> icarus::ComponentConfig::strings |
◆ type
| std::string icarus::ComponentConfig::type |
◆ vectors
| std::unordered_map<std::string, std::vector<double> > icarus::ComponentConfig::vectors |
The documentation for this struct was generated from the following file: