|
DNDSR 0.1.0.dev1+gcd065ad
Distributed Numeric Data Structure for CFV
|
Builder object passed to the user's registration function. More...
#include <ConfigParam.hpp>
Public Member Functions | |
| template<typename V , typename... Tags> | |
| void | field (V T::*member, const char *jsonKey, const char *desc, Tags &&...tags) |
| Register a field with pointer-to-member. | |
| template<typename V , typename... Tags> | |
| void | field_alias (V T::*member, const char *jsonKey, const char *desc, Tags &&...tags) |
| Register a field whose JSON key differs from the C++ member name. | |
| template<typename S , typename... Tags> | |
| void | field_section (S T::*member, const char *jsonKey, const char *desc, Tags &&...tags) |
| Register a nested sub-section. The sub-section type must itself use DNDS_DECLARE_CONFIG. | |
| template<typename S , typename... Tags> | |
| void | field_array_of (std::vector< S > T::*member, const char *jsonKey, const char *desc, Tags &&...tags) |
Register a std::vector<S> field (array of sub-objects). | |
| template<typename S , typename... Tags> | |
| void | field_map_of (std::map< std::string, S > T::*member, const char *jsonKey, const char *desc, Tags &&...tags) |
Register a std::map<std::string, S> field. | |
| template<typename... Tags> | |
| void | field_json (nlohmann::ordered_json T::*member, const char *jsonKey, const char *desc, Tags &&...tags) |
Register an opaque nlohmann::ordered_json field. | |
| template<typename FSchema , typename... Tags> | |
| void | field_json_schema (nlohmann::ordered_json T::*member, const char *jsonKey, const char *desc, FSchema &&schemaFn, Tags &&...tags) |
Register an opaque nlohmann::ordered_json field with a user-supplied schema generator. | |
| template<typename F > | |
| auto | check (F &&f) -> decltype(f(std::declval< const T & >()), void()) |
| Register a context-free cross-field check. | |
| template<typename F > | |
| void | check (const char *msg, F &&pred) |
| Register a context-free cross-field check with a message string. | |
| template<typename F > | |
| auto | check_ctx (F &&f) -> decltype(f(std::declval< const T & >(), std::declval< const ConfigContext & >()), void()) |
| Register a context-aware cross-field check. | |
| template<typename F > | |
| void | post_read (F &&f) |
| Register a post-read hook for recomputing derived quantities. | |
Builder object passed to the user's registration function.
Named config in the DNDS_DECLARE_CONFIG expansion for readability. Provides field() (called via DNDS_FIELD macro), check(), check_ctx(), and specialized field registrars for sections, arrays, maps, and JSON blobs.
Definition at line 350 of file ConfigParam.hpp.
|
inline |
Register a context-free cross-field check with a message string.
| msg | Error message shown when the check fails. |
| pred | Lambda (const T&) -> bool, returns true if the check passes. |
Definition at line 581 of file ConfigParam.hpp.
|
inline |
Register a context-free cross-field check.
| f | Lambda (const T&) -> CheckResult. |
Definition at line 568 of file ConfigParam.hpp.
|
inline |
Register a context-aware cross-field check.
| f | Lambda (const T&, const ConfigContext&) -> CheckResult. |
Definition at line 596 of file ConfigParam.hpp.
|
inline |
Register a field with pointer-to-member.
Typically called via the DNDS_FIELD macro (which auto-stringifies the member name). Can also be called directly for aliased keys.
| member | Pointer-to-member (e.g. &T::CFL). |
| jsonKey | The JSON key string. |
| desc | Human-readable description. |
| tags | Zero or more DNDS::Config tag objects. |
Definition at line 365 of file ConfigParam.hpp.
|
inline |
Register a field whose JSON key differs from the C++ member name.
Definition at line 398 of file ConfigParam.hpp.
|
inline |
Register a std::vector<S> field (array of sub-objects).
Definition at line 437 of file ConfigParam.hpp.
|
inline |
Register an opaque nlohmann::ordered_json field.
Definition at line 500 of file ConfigParam.hpp.
|
inline |
Register an opaque nlohmann::ordered_json field with a user-supplied schema generator.
Use this for heterogeneous structures (e.g. arrays of discriminated union objects) where automatic schema inference is not possible.
| member | Pointer-to-member. |
| jsonKey | JSON key name. |
| desc | Human-readable description. |
| schemaFn | Callable () -> ordered_json returning the full JSON Schema for this field. |
| tags | Optional tag objects. |
Definition at line 539 of file ConfigParam.hpp.
|
inline |
Register a std::map<std::string, S> field.
Definition at line 468 of file ConfigParam.hpp.
|
inline |
Register a nested sub-section. The sub-section type must itself use DNDS_DECLARE_CONFIG.
Definition at line 408 of file ConfigParam.hpp.
|
inline |
Register a post-read hook for recomputing derived quantities.
| f | Lambda (T&) -> void, called after readFromJson completes. |
Definition at line 610 of file ConfigParam.hpp.