From cf772688f01eb66469d8c0779cc31651e1ba609d Mon Sep 17 00:00:00 2001 From: gereon Date: Fri, 8 Mar 2013 12:04:42 +0100 Subject: [PATCH] added setter for options in Settings class. --- src/utility/Settings.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/utility/Settings.h b/src/utility/Settings.h index b35e893c4..900b34673 100644 --- a/src/utility/Settings.h +++ b/src/utility/Settings.h @@ -70,6 +70,23 @@ namespace settings { inline const bool isSet(std::string const & name) const { return this->vm.count(name) > 0; } + + /*! + * @brief Set an option. + */ + inline void set(std::string const & name) { + bpo::variable_value val; + this->vm.insert( std::make_pair(name, val) ); + } + + /*! + * @brief Set value for an option. + */ + template + inline void set(std::string const & name, T const & value) { + bpo::variable_value val(value, false); + this->vm.insert( std::make_pair(name, val) ); + } /*! * @brief Register a new module.