Browse Source

Convenience operation hasVariable for varset

tempestpy_adaptions
Sebastian Junges 8 years ago
parent
commit
071d1222a1
  1. 6
      src/storm/storage/jani/VariableSet.cpp
  2. 4
      src/storm/storage/jani/VariableSet.h

6
src/storm/storage/jani/VariableSet.cpp

@ -112,7 +112,11 @@ namespace storm {
bool VariableSet::hasVariable(std::string const& name) const {
return nameToVariable.find(name) != nameToVariable.end();
}
bool VariableSet::hasVariable(Variable const& var) const {
return hasVariable(var.getName());
}
Variable const& VariableSet::getVariable(std::string const& name) const {
auto it = nameToVariable.find(name);
STORM_LOG_THROW(it != nameToVariable.end(), storm::exceptions::InvalidArgumentException, "Unable to retrieve unknown variable '" << name << "'.");

4
src/storm/storage/jani/VariableSet.h

@ -103,6 +103,10 @@ namespace storm {
*/
Variable const& getVariable(std::string const& name) const;
/*!
* Retrieves whether this variable set contains a given variable.
*/
bool hasVariable(storm::jani::Variable const& variable) const;
/*!
* Retrieves whether this variable set contains a variable with the expression variable.
*/

Loading…
Cancel
Save