Browse Source

Renamed commandName to actionName, added getter for actionName

tempestpy_adaptions
gereon 12 years ago
parent
commit
03ca1e880d
  1. 13
      src/ir/Command.cpp
  2. 12
      src/ir/Command.h

13
src/ir/Command.cpp

@ -14,16 +14,21 @@ namespace storm {
namespace ir { namespace ir {
// Initializes all members with their default constructors. // Initializes all members with their default constructors.
Command::Command() : commandName(), guardExpression(), updates() {
Command::Command() : actionName(), guardExpression(), updates() {
// Nothing to do here. // Nothing to do here.
} }
// Initializes all members according to the given values. // Initializes all members according to the given values.
Command::Command(std::string commandName, std::shared_ptr<storm::ir::expressions::BaseExpression> guardExpression, std::vector<storm::ir::Update> updates)
: commandName(commandName), guardExpression(guardExpression), updates(updates) {
Command::Command(std::string actionName, std::shared_ptr<storm::ir::expressions::BaseExpression> guardExpression, std::vector<storm::ir::Update> updates)
: actionName(actionName), guardExpression(guardExpression), updates(updates) {
// Nothing to do here. // Nothing to do here.
} }
// Return the action name.
std::string const& Command::getActionName() const {
return this->actionName;
}
// Return the expression for the guard. // Return the expression for the guard.
std::shared_ptr<storm::ir::expressions::BaseExpression> const& Command::getGuard() const { std::shared_ptr<storm::ir::expressions::BaseExpression> const& Command::getGuard() const {
return guardExpression; return guardExpression;
@ -42,7 +47,7 @@ storm::ir::Update const& Command::getUpdate(uint_fast64_t index) const {
// Build a string representation of the command. // Build a string representation of the command.
std::string Command::toString() const { std::string Command::toString() const {
std::stringstream result; std::stringstream result;
result << "[" << commandName << "] " << guardExpression->toString() << " -> ";
result << "[" << actionName << "] " << guardExpression->toString() << " -> ";
for (uint_fast64_t i = 0; i < updates.size(); ++i) { for (uint_fast64_t i = 0; i < updates.size(); ++i) {
result << updates[i].toString(); result << updates[i].toString();
if (i < updates.size() - 1) { if (i < updates.size() - 1) {

12
src/ir/Command.h

@ -30,10 +30,16 @@ public:
/*! /*!
* Creates a command with the given name, guard and updates. * Creates a command with the given name, guard and updates.
* @param commandName the name of the command.
* @param actionName the action name of the command.
* @param guardExpression the expression that defines the guard of the command. * @param guardExpression the expression that defines the guard of the command.
*/ */
Command(std::string commandName, std::shared_ptr<storm::ir::expressions::BaseExpression> guardExpression, std::vector<storm::ir::Update> updates);
Command(std::string actionName, std::shared_ptr<storm::ir::expressions::BaseExpression> guardExpression, std::vector<storm::ir::Update> updates);
/*!
* Retrieves the action name of this command.
* @returns the action name of this command.
*/
std::string const& getActionName() const;
/*! /*!
* Retrieves a reference to the guard of the command. * Retrieves a reference to the guard of the command.
@ -61,7 +67,7 @@ public:
private: private:
// The name of the command. // The name of the command.
std::string commandName;
std::string actionName;
// The expression that defines the guard of the command. // The expression that defines the guard of the command.
std::shared_ptr<storm::ir::expressions::BaseExpression> guardExpression; std::shared_ptr<storm::ir::expressions::BaseExpression> guardExpression;

Loading…
Cancel
Save