MVSim
Lightweight simulator for 2.5D vehicles and robots
Public Member Functions | Public Attributes | List of all members
mvsim::TParamEntry Struct Reference

#include <TParameterDefinitions.h>

Public Member Functions

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

Public Attributes

const char * format = nullptr
 
void * val = nullptr
 

Detailed Description

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

Member Function Documentation

◆ parse()

void mvsim::TParamEntry::parse ( const std::string &  str,
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.

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