Skip to content
Snippets Groups Projects
Commit e8768584 authored by Giovanni Bussi's avatar Giovanni Bussi
Browse files

Added some methods to Action

to retrieve the label and the set of dependencies
parent 3193f87d
No related branches found
No related tags found
No related merge requests found
...@@ -44,7 +44,10 @@ class Action ...@@ -44,7 +44,10 @@ class Action
/// so as to check if all the present keywords are correct. /// so as to check if all the present keywords are correct.
std::vector<std::string> line; std::vector<std::string> line;
public:
typedef std::set<Action*> Dependencies; typedef std::set<Action*> Dependencies;
private:
/// Actions on which this Action depends. /// Actions on which this Action depends.
Dependencies after; Dependencies after;
/// Actions depending on this Action. /// Actions depending on this Action.
...@@ -116,6 +119,9 @@ public: ...@@ -116,6 +119,9 @@ public:
/// Returns the label /// Returns the label
const std::string & getLabel()const; const std::string & getLabel()const;
/// Returns the name
const std::string & getName()const;
/// Set action to active /// Set action to active
virtual void activate(); virtual void activate();
...@@ -124,6 +130,9 @@ public: ...@@ -124,6 +130,9 @@ public:
/// Check if action is active /// Check if action is active
bool isActive()const; bool isActive()const;
/// Return dependencies
const Dependencies & getDependencies()const{return after;}
}; };
///////////////////// /////////////////////
...@@ -134,6 +143,11 @@ const std::string & Action::getLabel()const{ ...@@ -134,6 +143,11 @@ const std::string & Action::getLabel()const{
return label; return label;
} }
inline
const std::string & Action::getName()const{
return name;
}
template<class T> template<class T>
void Action::parse(const std::string&key,T&t){ void Action::parse(const std::string&key,T&t){
if(!Tools::parse(line,key,t)){ if(!Tools::parse(line,key,t)){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment