From 6621cb814c72e701e08c84ba57de442a207f5101 Mon Sep 17 00:00:00 2001 From: TimQu Date: Wed, 12 Jul 2017 10:42:04 +0200 Subject: [PATCH] new argument validator: doubleRangeValidatorIncluding --- src/storm/settings/ArgumentValidators.cpp | 9 +++++++++ src/storm/settings/ArgumentValidators.h | 5 +++++ 2 files changed, 14 insertions(+) diff --git a/src/storm/settings/ArgumentValidators.cpp b/src/storm/settings/ArgumentValidators.cpp index b8896590d..8e108b454 100644 --- a/src/storm/settings/ArgumentValidators.cpp +++ b/src/storm/settings/ArgumentValidators.cpp @@ -133,6 +133,10 @@ namespace storm { return createRangeValidatorExcluding(lowerBound, upperBound); } + std::shared_ptr> ArgumentValidatorFactory::createDoubleRangeValidatorIncluding(double lowerBound, double upperBound) { + return createRangeValidatorIncluding(lowerBound, upperBound); + } + std::shared_ptr> ArgumentValidatorFactory::createIntegerGreaterValidator(int_fast64_t lowerBound) { return createGreaterValidator(lowerBound, false); } @@ -174,6 +178,11 @@ namespace storm { return std::make_unique>(lowerBound, upperBound, false, false); } + template + std::shared_ptr> ArgumentValidatorFactory::createRangeValidatorIncluding(ValueType lowerBound, ValueType upperBound) { + return std::make_unique>(lowerBound, upperBound, true, true); + } + template std::shared_ptr> ArgumentValidatorFactory::createGreaterValidator(ValueType lowerBound, bool equalAllowed) { return std::make_unique>(lowerBound, boost::none, equalAllowed, false); diff --git a/src/storm/settings/ArgumentValidators.h b/src/storm/settings/ArgumentValidators.h index bbdb861f5..4b3b0b3d8 100644 --- a/src/storm/settings/ArgumentValidators.h +++ b/src/storm/settings/ArgumentValidators.h @@ -70,6 +70,8 @@ namespace storm { static std::shared_ptr> createUnsignedRangeValidatorExcluding(uint64_t lowerBound, uint64_t upperBound); static std::shared_ptr> createDoubleRangeValidatorExcluding(double lowerBound, double upperBound); + static std::shared_ptr> createDoubleRangeValidatorIncluding(double lowerBound, double upperBound); + static std::shared_ptr> createIntegerGreaterValidator(int_fast64_t lowerBound); static std::shared_ptr> createUnsignedGreaterValidator(uint64_t lowerBound); static std::shared_ptr> createDoubleGreaterValidator(double lowerBound); @@ -87,6 +89,9 @@ namespace storm { template static std::shared_ptr> createRangeValidatorExcluding(ValueType lowerBound, ValueType upperBound); + template + static std::shared_ptr> createRangeValidatorIncluding(ValueType lowerBound, ValueType upperBound); + template static std::shared_ptr> createGreaterValidator(ValueType lowerBound, bool equalAllowed); };