Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

Diff Revisions 330 vs 331 for /trunk/Source Code/Core/Headers/ParamHandler.h

Diff revisions: vs.
  @@ -35,16 +35,17 @@
35 35 DEFINE_SINGLETON (ParamHandler)
36 36 typedef hashMapImpl<stringImpl, cdiggins::any> ParamMap;
37 37 /// A special map for string types (small perf. optimization for add/retrieve)
38 - typedef hashMapImpl<stringImpl, stringImpl > ParamStringMap;
39 - /// A special map for boolean types (small perf. optimization for add/retrieve. Used a lot as option toggles)
40 - typedef hashMapImpl<stringImpl, bool > ParamBoolMap;
38 + typedef hashMapImpl<stringImpl, stringImpl > ParamStringMap;
39 + /// A special map for boolean types (small perf. optimization for add/retrieve)
40 + /// Used a lot as option toggles
41 + typedef hashMapImpl<stringImpl, bool > ParamBoolMap;
41 42
42 43 public:
43 44 inline void setDebugOutput(bool logState) {
44 45 _logState = logState;
45 46 }
46 47
47 - template <typename T>
48 + template<typename T>
48 49 inline T getParam(const stringImpl& name, T defaultValue = T()) const {
49 50 ReadLock r_lock(_mutex);
50 51 ParamMap::const_iterator it = _params.find(name);
  @@ -54,7 +55,8 @@
54 55 # ifdef _DEBUG
55 56 if (!success) {
56 57 ERROR_FN(Locale::get("ERROR_PARAM_CAST"),name.c_str());
57 - DIVIDE_ASSERT(success, "ParamHandler error: Can't cast requested param to specified type!");
58 + DIVIDE_ASSERT(success,
59 + "ParamHandler error: Can't cast requested param to specified type!");
58 60 }
59 61 # endif
60 62
  @@ -70,7 +72,8 @@
70 72 WriteLock w_lock(_mutex);
71 73 ParamMap::iterator it = _params.find(name);
72 74 if (it == _params.end()) {
73 - DIVIDE_ASSERT(emplace(_params, name, cdiggins::any(value)).second, "ParamHandler error: can't add specified value to map!");
75 + DIVIDE_ASSERT(emplace(_params, name, cdiggins::any(value)).second,
76 + "ParamHandler error: can't add specified value to map!");
74 77 } else {
75 78 it->second = cdiggins::any(value);
76 79 }
  @@ -112,7 +115,8 @@
112 115 WriteLock w_lock(_mutex);
113 116 ParamStringMap::iterator it = _paramsStr.find(name);
114 117 if (it == _paramsStr.end()) {
115 - DIVIDE_ASSERT(emplace(_paramsStr, name, value).second, "ParamHandler error: can't add specified value to map!");
118 + DIVIDE_ASSERT(emplace(_paramsStr, name, value).second,
119 + "ParamHandler error: can't add specified value to map!");
116 120 } else {
117 121 it->second = value;
118 122 }
  @@ -171,7 +175,8 @@
171 175 WriteLock w_lock(_mutex);
172 176 ParamBoolMap::iterator it = _paramBool.find(name);
173 177 if (it == _paramBool.end()) {
174 - DIVIDE_ASSERT(emplace(_paramBool, name, value).second, "ParamHandler error: can't add specified value to map!");
178 + DIVIDE_ASSERT(emplace(_paramBool, name, value).second,
179 + "ParamHandler error: can't add specified value to map!");
175 180 } else {
176 181 it->second = value;
177 182 }