From e8768584b2b29e1f36e79290748f5da44efcd513 Mon Sep 17 00:00:00 2001 From: Giovanni Bussi <giovanni.bussi@gmail.com> Date: Fri, 17 Jun 2011 10:40:55 +0200 Subject: [PATCH] Added some methods to Action to retrieve the label and the set of dependencies --- src/Action.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/Action.h b/src/Action.h index 499e9a255..367cedf51 100644 --- a/src/Action.h +++ b/src/Action.h @@ -44,7 +44,10 @@ class Action /// so as to check if all the present keywords are correct. std::vector<std::string> line; +public: typedef std::set<Action*> Dependencies; + +private: /// Actions on which this Action depends. Dependencies after; /// Actions depending on this Action. @@ -116,6 +119,9 @@ public: /// Returns the label const std::string & getLabel()const; +/// Returns the name + const std::string & getName()const; + /// Set action to active virtual void activate(); @@ -124,6 +130,9 @@ public: /// Check if action is active bool isActive()const; + +/// Return dependencies + const Dependencies & getDependencies()const{return after;} }; ///////////////////// @@ -134,6 +143,11 @@ const std::string & Action::getLabel()const{ return label; } +inline +const std::string & Action::getName()const{ + return name; +} + template<class T> void Action::parse(const std::string&key,T&t){ if(!Tools::parse(line,key,t)){ -- GitLab