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 34 of file TParameterDefinitions.h.

Constructor & Destructor Documentation

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

Definition at line 42 of file TParameterDefinitions.h.

Member Function Documentation

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 32 of file xml_utils.cpp.

Member Data Documentation

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

Definition at line 36 of file TParameterDefinitions.h.

void* mvsim::TParamEntry::val = nullptr

Definition at line 37 of file TParameterDefinitions.h.


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


mvsim
Author(s):
autogenerated on Fri May 7 2021 03:05:52