You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

22 lines
738 B

#include "src/settings/SettingMemento.h"
#include "src/settings/modules/ModuleSettings.h"
namespace storm {
namespace settings {
SettingMemento::SettingMemento(modules::ModuleSettings& settings, std::string const& longOptionName, bool resetToState) : settings(settings), optionName(longOptionName), resetToState(resetToState) {
// Intentionally left empty.
}
/*!
* Destructs the memento object and resets the value of the option to its original state.
*/
SettingMemento::~SettingMemento() {
if (resetToState) {
settings.set(optionName);
} else {
settings.unset(optionName);
}
}
}
}