-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsystemtargetinfo.hpp
65 lines (51 loc) · 1.61 KB
/
systemtargetinfo.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
//@ {
//@ "targets":[{"name":"systemtargetinfo.hpp","type":"include"}]
//@ ,"dependencies_extra":[{"ref":"systemtargetinfo.o","rel":"implementation"}]
//@ }
#ifndef MAIKE_SYSTEMTARGETINFO_HPP
#define MAIKE_SYSTEMTARGETINFO_HPP
#include "parametersetdumpable.hpp"
#include "visibility.hpp"
#include "mapreplace.hpp"
#include "variant.hpp"
#include "stringkey.hpp"
#include <string>
#include <map>
#include <vector>
namespace Maike
{
class PRIVATE SystemTargetInfo final:public ParameterSetDumpable
{
public:
SystemTargetInfo();
~SystemTargetInfo() noexcept;
void parameterGet(const Stringkey& key
,ParameterProcessor&& proc) const;
Variant variableGet(const Stringkey& key) const noexcept;
void variableSet(const char* key,const char* str)
{
auto key_hash=Stringkey(key);
m_varnames[key_hash]=std::string(key);
auto i=replace(m_strings,{key_hash,std::string(str)});
replace(m_sysvars,{key_hash,Variant(i->second.c_str())});
}
template<class T>
void variableSet(const char* key,const T& value)
{
auto key_hash=Stringkey(key);
m_varnames[key_hash]=std::string(key);
replace(m_sysvars,{key_hash,Variant(value)});
}
void clear();
SystemTargetInfo& configAppend(const ResourceObject& targetinfo);
void configDump(ResourceObject& targetinfo) const;
ResourceObject configDump() const;
SystemTargetInfo& sysvarsLoad();
SystemTargetInfo& configAppendDefault();
private:
std::map<Stringkey,Variant> m_sysvars;
std::map<Stringkey,std::string> m_strings;
std::map<Stringkey,std::string> m_varnames;
};
}
#endif // MAIKE_SYSTEMINFO_HPP