Public Member Functions | Public Attributes | List of all members
mvsim::TParamEntry Struct Reference

#include <TParameterDefinitions.h>

Public Member Functions

void parse (const std::string &str, const std::string &varName, const std::map< std::string, std::string > &variableNamesValues={}, const char *functionNameContext="") const
 
 TParamEntry ()=default
 
template<typename T >
 TParamEntry (const char *frmt_, T *targetVariable)
 

Public Attributes

const char * frmt = nullptr
 
voidval = nullptr
 

Detailed Description

Normal case: sscanf()-like specifiers, and "void*" pointing to corresponding variable type. Special cases:

Todo:
Rewrite using std::variant?

Definition at line 38 of file TParameterDefinitions.h.

Constructor & Destructor Documentation

◆ TParamEntry() [1/2]

mvsim::TParamEntry::TParamEntry ( )
default

◆ TParamEntry() [2/2]

template<typename T >
mvsim::TParamEntry::TParamEntry ( const char *  frmt_,
T *  targetVariable 
)
inline

Definition at line 46 of file TParameterDefinitions.h.

Member Function Documentation

◆ parse()

void TParamEntry::parse ( const std::string &  inStr,
const std::string &  varName,
const std::map< std::string, std::string > &  variableNamesValues = {},
const char *  functionNameContext = "" 
) const

Tries to parse the given input string according to the expected format, then store the result in "*val"

Exceptions
std::runtime_errorOn format errors.

Definition at line 35 of file xml_utils.cpp.

Member Data Documentation

◆ frmt

const char* mvsim::TParamEntry::frmt = nullptr

Definition at line 40 of file TParameterDefinitions.h.

◆ val

void* mvsim::TParamEntry::val = nullptr

Definition at line 41 of file TParameterDefinitions.h.


The documentation for this struct was generated from the following files:


mvsim
Author(s):
autogenerated on Tue Jul 4 2023 03:08:23