aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/corelib/buildgraph/artifactset.h
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@digia.com>2014-02-10 18:08:01 +0100
committerJoerg Bornemann <joerg.bornemann@digia.com>2014-02-13 15:33:27 +0100
commite73f60919079fc7cb0f0ad6d50b1a364c7b0d2a6 (patch)
tree3ce15f1f9b336063d591999ce325ce28a6e21320 /src/lib/corelib/buildgraph/artifactset.h
parenta3634a6bbb193c47cdec887a6b29356c979961aa (diff)
support transformers with an unknown number of outputs
To support different types of nodes in the build graph, we introduce the base class BuildGraphNode. Artifact now derives from BuildGraphNode. A RuleNode class is introduced that represents a rule in the build graph. Rules are applied in the build phase and not in a pre-build phase anymore. The handling of moc has been revisited. The fixed automoc pre-build phase is no more. This is the squashed merge of a feature branch. Task-number: QBS-370 Change-Id: If27cdc51cba8c9542e4282c2caa456faa723aeff Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
Diffstat (limited to 'src/lib/corelib/buildgraph/artifactset.h')
-rw-r--r--src/lib/corelib/buildgraph/artifactset.h70
1 files changed, 6 insertions, 64 deletions
diff --git a/src/lib/corelib/buildgraph/artifactset.h b/src/lib/corelib/buildgraph/artifactset.h
index fccff34d9..092e9e8a2 100644
--- a/src/lib/corelib/buildgraph/artifactset.h
+++ b/src/lib/corelib/buildgraph/artifactset.h
@@ -30,80 +30,22 @@
#ifndef QBS_ARTIFACTSET_H
#define QBS_ARTIFACTSET_H
-#include <set>
-#include <cstddef>
+#include <QSet>
namespace qbs {
namespace Internal {
class Artifact;
+class NodeSet;
-/**
- * Set that holds a bunch of build graph artifacts.
- * This is faster than QSet when iterating over the container.
- */
-class ArtifactSet
+class ArtifactSet : public QSet<Artifact *>
{
public:
ArtifactSet();
ArtifactSet(const ArtifactSet &other);
-
- ArtifactSet &unite(const ArtifactSet &other);
-
- typedef std::set<Artifact *>::const_iterator const_iterator;
- typedef std::set<Artifact *>::iterator iterator;
- typedef Artifact * value_type;
-
- iterator begin() { return m_data.begin(); }
- iterator end() { return m_data.end(); }
- const_iterator begin() const { return m_data.begin(); }
- const_iterator end() const { return m_data.end(); }
- const_iterator constBegin() const { return m_data.begin(); }
- const_iterator constEnd() const { return m_data.end(); }
-
- void insert(Artifact *artifact)
- {
- m_data.insert(artifact);
- }
-
- void operator +=(Artifact *artifact)
- {
- insert(artifact);
- }
-
- void remove(Artifact *artifact);
-
- bool contains(Artifact *artifact) const
- {
- return m_data.find(artifact) != m_data.end();
- }
-
- void clear()
- {
- m_data.clear();
- }
-
- bool isEmpty() const
- {
- return m_data.empty();
- }
-
- int count() const
- {
- return (int)m_data.size();
- }
-
- void reserve(int)
- {
- // no-op
- }
-
- bool operator==(const ArtifactSet &other) const { return m_data == other.m_data; }
- bool operator!=(const ArtifactSet &other) const { return !(*this == other); }
-
-
-private:
- std::set<Artifact *> m_data;
+ ArtifactSet(const QSet<Artifact *> &other);
+ static ArtifactSet fromNodeSet(const NodeSet &nodes);
+ static ArtifactSet fromNodeList(const QList<Artifact *> &lst);
};
} // namespace Internal