Manages immutable component properties.
More...
#include <properties.hpp>
|
| Properties (void) |
| Default constructor for empty properties.
|
|
| Properties (const std::map< std::string, std::any > &attributes) |
| Construct properties from a map of attributes.
|
|
template<typename T > |
T | get (const std::string &key) const |
| Get a property value by key with type casting.
|
|
bool | has (const std::string &key) const |
| Check if a property key exists.
|
|
const std::map< std::string, std::any > & | getAttributes (void) const |
| Get all property attributes.
|
|
Manages immutable component properties.
The Properties class provides read-only access to component configuration data passed from parent components. Properties cannot be modified after construction.
◆ Properties()
Properties::Properties |
( |
const std::map< std::string, std::any > & |
attributes | ) |
|
|
inline |
Construct properties from a map of attributes.
- Parameters
-
attributes | Map of key-value pairs to store as properties |
◆ get()
template<typename T >
T Properties::get |
( |
const std::string & |
key | ) |
const |
|
inline |
Get a property value by key with type casting.
- Template Parameters
-
T | The type to cast the value to |
- Parameters
-
- Returns
- The value cast to type T, or default-constructed T if key doesn't exist
◆ getAttributes()
const std::map< std::string, std::any > & Properties::getAttributes |
( |
void |
| ) |
const |
|
inline |
Get all property attributes.
- Returns
- Const reference to the map containing all property key-value pairs
◆ has()
bool Properties::has |
( |
const std::string & |
key | ) |
const |
|
inline |
Check if a property key exists.
- Parameters
-
- Returns
- true if the key exists, false otherwise
The documentation for this class was generated from the following file: