summaryrefslogtreecommitdiff
path: root/src/lib/buildgraph/rulegraph.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/buildgraph/rulegraph.h')
-rw-r--r--src/lib/buildgraph/rulegraph.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/lib/buildgraph/rulegraph.h b/src/lib/buildgraph/rulegraph.h
index 510a4789c..39c2eeaba 100644
--- a/src/lib/buildgraph/rulegraph.h
+++ b/src/lib/buildgraph/rulegraph.h
@@ -42,6 +42,12 @@
namespace qbs {
namespace Internal {
+class RuleGraphVisitor
+{
+public:
+ virtual void visit(const RuleConstPtr &parentRule, const RuleConstPtr &rule) = 0;
+};
+
class RuleGraph
{
public:
@@ -49,6 +55,7 @@ public:
void build(const QSet<RulePtr> &rules, const FileTags &productFileTag);
QList<RuleConstPtr> topSorted();
+ void accept(RuleGraphVisitor *visitor) const;
void dump() const;
@@ -61,6 +68,8 @@ private:
void removeSiblings(const Rule *rule);
QList<RuleConstPtr> topSort(const RuleConstPtr &rule, QSet<const Rule *> *seenRules,
QList<const Rule *> *rulePath);
+ void traverse(RuleGraphVisitor *visitor, const RuleConstPtr &parentRule,
+ const RuleConstPtr &rule) const;
private:
QMap<FileTag, QList<const Rule*> > m_outputFileTagToRule;