TParameterDefinitions.h
Go to the documentation of this file.
1 /*+-------------------------------------------------------------------------+
2  | MultiVehicle simulator (libmvsim) |
3  | |
4  | Copyright (C) 2014-2023 Jose Luis Blanco Claraco |
5  | Copyright (C) 2017 Borys Tymchenko (Odessa Polytechnic University) |
6  | Distributed under 3-clause BSD License |
7  | See COPYING |
8  +-------------------------------------------------------------------------+ */
9 #pragma once
10 
11 #include <cstdlib>
12 #include <map>
13 #include <string>
14 
15 namespace mvsim
16 {
39 {
40  const char* frmt = nullptr;
41  void* val = nullptr;
42 
43  TParamEntry() = default;
44 
45  template <typename T>
46  TParamEntry(const char* frmt_, T* targetVariable)
47  : frmt(frmt_), val(reinterpret_cast<void*>(targetVariable))
48  {
49  }
50 
55  void parse(
56  const std::string& str, const std::string& varName,
57  const std::map<std::string, std::string>& variableNamesValues = {},
58  const char* functionNameContext = "") const;
59 };
60 
64 using TParameterDefinitions = std::map<std::string, TParamEntry>;
65 
66 } // namespace mvsim
std::map< std::string, TParamEntry > TParameterDefinitions
void parse(const std::string &str, const std::string &varName, const std::map< std::string, std::string > &variableNamesValues={}, const char *functionNameContext="") const
Definition: xml_utils.cpp:35
TParamEntry()=default
TParamEntry(const char *frmt_, T *targetVariable)
typedef void(GLAD_API_PTR *GLDEBUGPROC)(GLenum source


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