MCPcopy Create free account
hub / github.com/Xtra-Computing/thundersvm / setValue

Method setValue

include/thundersvm/util/log.h:2052–2072  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2050
2051 template <typename Conf_T>
2052 void setValue(Level level, const Conf_T& value, std::map<Level, Conf_T>* confMap, bool includeGlobalLevel = true) {
2053 // If map is empty and we are allowed to add into generic level (Level::Global), do it!
2054 if (confMap->empty() && includeGlobalLevel) {
2055 confMap->insert(std::make_pair(Level::Global, value));
2056 return;
2057 }
2058 // If same value exist in generic level already, dont add it to explicit level
2059 typename std::map<Level, Conf_T>::iterator it = confMap->find(Level::Global);
2060 if (it != confMap->end() && it->second == value) {
2061 return;
2062 }
2063 // Now make sure we dont double up values if we really need to add it to explicit level
2064 it = confMap->find(level);
2065 if (it == confMap->end()) {
2066 // Value not found for level, add new
2067 confMap->insert(std::make_pair(level, value));
2068 } else {
2069 // Value found, just update value
2070 confMap->at(level) = value;
2071 }
2072 }
2073
2074 void build(Configurations* configurations);
2075 unsigned long getULong(std::string confVal);

Callers

nothing calls this directly

Calls 2

endMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected