From 03ca1e880ddbb9c03affbb2077f62d6f9f6a355a Mon Sep 17 00:00:00 2001 From: gereon Date: Sun, 24 Feb 2013 17:49:37 +0100 Subject: [PATCH] Renamed commandName to actionName, added getter for actionName --- src/ir/Command.cpp | 13 +++++++++---- src/ir/Command.h | 12 +++++++++--- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/src/ir/Command.cpp b/src/ir/Command.cpp index 5cb4c6354..bec67d4bf 100644 --- a/src/ir/Command.cpp +++ b/src/ir/Command.cpp @@ -14,16 +14,21 @@ namespace storm { namespace ir { // Initializes all members with their default constructors. -Command::Command() : commandName(), guardExpression(), updates() { +Command::Command() : actionName(), guardExpression(), updates() { // Nothing to do here. } // Initializes all members according to the given values. -Command::Command(std::string commandName, std::shared_ptr guardExpression, std::vector updates) - : commandName(commandName), guardExpression(guardExpression), updates(updates) { +Command::Command(std::string actionName, std::shared_ptr guardExpression, std::vector updates) + : actionName(actionName), guardExpression(guardExpression), updates(updates) { // Nothing to do here. } +// Return the action name. +std::string const& Command::getActionName() const { + return this->actionName; +} + // Return the expression for the guard. std::shared_ptr const& Command::getGuard() const { return guardExpression; @@ -42,7 +47,7 @@ storm::ir::Update const& Command::getUpdate(uint_fast64_t index) const { // Build a string representation of the command. std::string Command::toString() const { std::stringstream result; - result << "[" << commandName << "] " << guardExpression->toString() << " -> "; + result << "[" << actionName << "] " << guardExpression->toString() << " -> "; for (uint_fast64_t i = 0; i < updates.size(); ++i) { result << updates[i].toString(); if (i < updates.size() - 1) { diff --git a/src/ir/Command.h b/src/ir/Command.h index 2ac54b525..9207c76f0 100644 --- a/src/ir/Command.h +++ b/src/ir/Command.h @@ -30,10 +30,16 @@ public: /*! * 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. */ - Command(std::string commandName, std::shared_ptr guardExpression, std::vector updates); + Command(std::string actionName, std::shared_ptr guardExpression, std::vector 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. @@ -61,7 +67,7 @@ public: private: // The name of the command. - std::string commandName; + std::string actionName; // The expression that defines the guard of the command. std::shared_ptr guardExpression;