DNDSR 0.1.0.dev1+gcd065ad
Distributed Numeric Data Structure for CFV
Loading...
Searching...
No Matches
DNDS::detail Namespace Reference

Classes

struct  EnumStringPair
 A pair of (enum-value, optional string) used to extract allowed values. More...
 
struct  is_eigen_type
 
struct  is_eigen_type< T, std::void_t< typename T::Scalar, decltype(static_cast< int >(T::RowsAtCompileTime)), decltype(static_cast< int >(T::ColsAtCompileTime))> >
 

Functions

template<typename EnumType >
std::vector< std::string > extractEnumStrings (std::initializer_list< EnumStringPair< EnumType > > pairs)
 Extract non-null string values from a list of enum-string pairs.
 
void applyTag (FieldMeta &meta, const Config::RangeTag &tag)
 
void applyTag (FieldMeta &meta, const Config::InfoTag &tag)
 
void applyTag (FieldMeta &meta, const Config::EnumValuesTag &tag)
 
void applyTags (FieldMeta &)
 
template<typename Tag , typename... Rest>
void applyTags (FieldMeta &meta, Tag &&tag, Rest &&...rest)
 
template<typename T , typename V >
std::function< nlohmann::ordered_json()> makeSchemaEntry (V T::*member, const char *desc, const FieldMeta &meta)
 Build the schemaEntry closure from a fully-tagged FieldMeta.
 
template<typename T , typename V >
std::function< void(const nlohmann::ordered_json &, const char *)> makeRangeChecker (const FieldMeta &meta)
 Build a runtime range-check closure.
 

Detailed Description

Eigen matrix/vector types serialize as JSON arrays, so map them to Array. Detection uses the Scalar typedef and RowsAtCompileTime enum that all Eigen matrix expressions expose — no Eigen headers needed here.

Function Documentation

◆ applyTag() [1/3]

void DNDS::detail::applyTag ( FieldMeta meta,
const Config::EnumValuesTag tag 
)
inline

Definition at line 252 of file ConfigParam.hpp.

◆ applyTag() [2/3]

void DNDS::detail::applyTag ( FieldMeta meta,
const Config::InfoTag tag 
)
inline

Definition at line 247 of file ConfigParam.hpp.

◆ applyTag() [3/3]

void DNDS::detail::applyTag ( FieldMeta meta,
const Config::RangeTag tag 
)
inline

Definition at line 241 of file ConfigParam.hpp.

Here is the caller graph for this function:

◆ applyTags() [1/2]

void DNDS::detail::applyTags ( FieldMeta )
inline

Definition at line 258 of file ConfigParam.hpp.

Here is the caller graph for this function:

◆ applyTags() [2/2]

template<typename Tag , typename... Rest>
void DNDS::detail::applyTags ( FieldMeta meta,
Tag &&  tag,
Rest &&...  rest 
)

Definition at line 261 of file ConfigParam.hpp.

Here is the call graph for this function:

◆ extractEnumStrings()

template<typename EnumType >
std::vector< std::string > DNDS::detail::extractEnumStrings ( std::initializer_list< EnumStringPair< EnumType > >  pairs)

Extract non-null string values from a list of enum-string pairs.

Definition at line 92 of file ConfigEnum.hpp.

◆ makeRangeChecker()

template<typename T , typename V >
std::function< void(const nlohmann::ordered_json &, const char *)> DNDS::detail::makeRangeChecker ( const FieldMeta meta)

Build a runtime range-check closure.

Returns a function that, given a JSON value for this field, checks it against min/max bounds and throws on violation. Returns nullptr if no range constraint is set.

Definition at line 310 of file ConfigParam.hpp.

◆ makeSchemaEntry()

template<typename T , typename V >
std::function< nlohmann::ordered_json()> DNDS::detail::makeSchemaEntry ( V T::*  member,
const char *  desc,
const FieldMeta meta 
)

Build the schemaEntry closure from a fully-tagged FieldMeta.

Captures the pointer-to-member, description, and all tag data (range, enum, aux info) to produce the JSON Schema fragment on demand.

Definition at line 273 of file ConfigParam.hpp.

Here is the call graph for this function: