Skip to content

Commit 7ff9060

Browse files
committed
multizone implementation
1 parent ab5ab6c commit 7ff9060

7 files changed

Lines changed: 129 additions & 147 deletions

File tree

Common/include/option_structure.hpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2268,35 +2268,35 @@ class COptionBase {
22682268
private:
22692269
std::vector<std::string> value;
22702270
public:
2271-
COptionBase() {};
2272-
virtual ~COptionBase() = 0;
2271+
virtual ~COptionBase() = default;
22732272

2274-
virtual std::string SetValue(std::vector<std::string> value){this->value = value; return "";}
2275-
std::vector<std::string> GetValue() {return value;}
2273+
const std::vector<std::string>& GetValue() const {return value;}
2274+
2275+
virtual std::string SetValue(const std::vector<std::string>& val) {
2276+
value = val;
2277+
return "";
2278+
}
22762279
virtual void SetDefault() = 0;
22772280

2278-
std::string optionCheckMultipleValues(std::vector<std::string> & option_value, std::string type_id, std::string option_name) {
2281+
std::string optionCheckMultipleValues(const std::vector<std::string>& option_value,
2282+
std::string type_id, const std::string& option_name) {
22792283
if (option_value.size() != 1) {
2280-
std::string newString;
2281-
newString.append(option_name);
2284+
std::string newString(option_name);
22822285
newString.append(": multiple values for type ");
22832286
newString.append(type_id);
22842287
return newString;
22852288
}
22862289
return "";
22872290
}
22882291

2289-
std::string badValue(std::vector<std::string> & option_value, std::string type_id, std::string option_name) {
2290-
std::string newString;
2291-
newString.append(option_name);
2292+
std::string badValue(std::string type_id, const std::string& option_name) {
2293+
std::string newString(option_name);
22922294
newString.append(": improper option value for type ");
22932295
newString.append(type_id);
22942296
return newString;
22952297
}
22962298
};
22972299

2298-
inline COptionBase::~COptionBase() {}
2299-
23002300
#ifdef ENABLE_MAPS
23012301
#include "option_structure.inl"
23022302
#endif

0 commit comments

Comments
 (0)