|
DNDSR 0.1.0.dev1+gcd065ad
Distributed Numeric Data Structure for CFV
|
Descriptor for a single configuration field. More...
#include <ConfigRegistry.hpp>
Public Attributes | |
| std::string | name |
| JSON key name (may differ from C++ member name for aliased fields). | |
| std::string | description |
| Human-readable description, used in JSON Schema and generated docs. | |
| ConfigTypeTag | typeTag |
| JSON Schema type category. | |
| std::function< void(const nlohmann::ordered_json &j, void *obj)> | readField |
| Read this field from a JSON object into a struct instance. | |
| std::function< void(nlohmann::ordered_json &j, const void *obj)> | writeField |
| Write this field from a struct instance into a JSON object. | |
| std::function< nlohmann::ordered_json()> | schemaEntry |
| Emit the JSON Schema fragment for this field. | |
| std::vector< std::string > | enumValues |
| Allowed string values for enum fields. Empty for non-enum fields. | |
| std::optional< double > | minimum |
| Optional minimum constraint for numeric fields (used in schema + validation). | |
| std::optional< double > | maximum |
| Optional maximum constraint for numeric fields (used in schema + validation). | |
| std::map< std::string, std::string > | auxInfo |
Auxiliary key-value info (emitted as "x-<key>": "<value>" in schema). Use for units, references, version notes, etc. | |
Descriptor for a single configuration field.
Stores everything needed to serialize, deserialize, validate, and generate JSON Schema for one member of a config struct. Created by ConfigSectionBuilder::field() (typically via the DNDS_FIELD macro) and stored in the per-type ConfigRegistry<T> singleton.
All std::function members capture a pointer-to-member and description string. They live in host-side static storage and never reference instance state.
Definition at line 158 of file ConfigRegistry.hpp.
| std::map<std::string, std::string> DNDS::FieldMeta::auxInfo |
Auxiliary key-value info (emitted as "x-<key>": "<value>" in schema). Use for units, references, version notes, etc.
Definition at line 195 of file ConfigRegistry.hpp.
| std::string DNDS::FieldMeta::description |
Human-readable description, used in JSON Schema and generated docs.
Definition at line 161 of file ConfigRegistry.hpp.
| std::vector<std::string> DNDS::FieldMeta::enumValues |
Allowed string values for enum fields. Empty for non-enum fields.
Definition at line 185 of file ConfigRegistry.hpp.
| std::optional<double> DNDS::FieldMeta::maximum |
Optional maximum constraint for numeric fields (used in schema + validation).
Definition at line 191 of file ConfigRegistry.hpp.
| std::optional<double> DNDS::FieldMeta::minimum |
Optional minimum constraint for numeric fields (used in schema + validation).
Definition at line 188 of file ConfigRegistry.hpp.
| std::string DNDS::FieldMeta::name |
JSON key name (may differ from C++ member name for aliased fields).
Definition at line 160 of file ConfigRegistry.hpp.
| std::function<void(const nlohmann::ordered_json &j, void *obj)> DNDS::FieldMeta::readField |
Read this field from a JSON object into a struct instance.
| j | The JSON object to read from (must contain name as a key). |
| obj | Pointer to the struct instance (type-erased as void*). |
| nlohmann::json::out_of_range | if the key is missing. |
| nlohmann::json::type_error | if the JSON value type doesn't match. |
Definition at line 169 of file ConfigRegistry.hpp.
| std::function<nlohmann::ordered_json()> DNDS::FieldMeta::schemaEntry |
Emit the JSON Schema fragment for this field.
{"type":"number","default":1e100,"description":"..."}.For enum fields, also includes "enum": [...]. For object fields, delegates to the nested section's ConfigRegistry::emitSchema(). For array fields, includes "items": {...}.
Definition at line 182 of file ConfigRegistry.hpp.
| ConfigTypeTag DNDS::FieldMeta::typeTag |
JSON Schema type category.
Definition at line 162 of file ConfigRegistry.hpp.
| std::function<void(nlohmann::ordered_json &j, const void *obj)> DNDS::FieldMeta::writeField |
Write this field from a struct instance into a JSON object.
| j | The JSON object to write into. |
| obj | Pointer to the struct instance (type-erased as const void*). |
Definition at line 174 of file ConfigRegistry.hpp.