From 6cde9cfcf21e18cd175008029432b91143578033 Mon Sep 17 00:00:00 2001 From: Andreas Stöckel Date: Fri, 30 Jan 2015 18:19:03 +0100 Subject: Added Argument::Cardinality named constructor to Argument --- src/core/common/Argument.hpp | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'src/core/common/Argument.hpp') diff --git a/src/core/common/Argument.hpp b/src/core/common/Argument.hpp index 8d01c2d..42b1722 100644 --- a/src/core/common/Argument.hpp +++ b/src/core/common/Argument.hpp @@ -369,6 +369,27 @@ public: static Argument Map(std::string name, const Rtti &innerType, const Variant::mapType &defaultValue); + /** + * Named constructor for a cardinality argument with no default value. + * + * @param name is the name of the argument as used for error messages and in + * case the arguments are given as a map. + * @return a new Argument instance. + */ + static Argument Cardinality(std::string name); + + /** + * Named constructor for a Cardinality argument with default value. + * + * @param name is the name of the argument as used for error messages and in + * case the arguments are given as a map. + * @param defaultValue is the default value to be used in case this argument + * is not supplied. + * @return a new Argument instance. + */ + static Argument Cardinality(std::string name, + Variant::cardinalityType defaultValue); + /** * Makes sure the given variant is in the requested format and returns true * if the variant was valid. Logs any error to the given logger instance. @@ -409,7 +430,6 @@ private: bool valid; public: - /** * Static Arguments instance with no explicit arguments set. */ @@ -418,7 +438,7 @@ public: /** * Default constructor. Provides no arguments. */ - Arguments() : valid(false) {}; + Arguments() : valid(false){}; /** * Constructor of the Arguments class from a list of Argument instances. -- cgit v1.2.3