Added more constructors to ParamConstraint

This commit is contained in:
Leonetienne 2021-06-02 21:19:20 +02:00
parent f2b90f0caa
commit 8afa0bb351
2 changed files with 23 additions and 0 deletions

Binary file not shown.

View File

@ -6,7 +6,10 @@
struct ParamConstraint
{
public:
//! Empty constructor
ParamConstraint() = default;
//! Whole constructor
ParamConstraint(const std::string& key, bool constrainType, DATA_TYPE wantedType, const std::vector<std::string>& defaultValue, bool required)
:
key { key },
@ -18,6 +21,26 @@ public:
return;
}
//! Type-Constraint constructor
ParamConstraint(const std::string& key, bool constrainType, DATA_TYPE wantedType)
:
key{ key },
constrainType{ constrainType },
wantedType{ wantedType }
{
return;
}
//! Require-Constraint constructor
ParamConstraint(const std::string& key, const std::vector<std::string>& defaultValue, bool required = false)
:
key{ key },
defaultValue{ defaultValue },
required{ required }
{
return;
}
//! The key of the parameter to constrain
std::string key;