aboutsummaryrefslogtreecommitdiff
path: root/build/algorithm
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-02-23 15:56:03 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-02-23 15:56:03 +0200
commitfefe0657f29b8db782f7a722dd46b074b991cf08 (patch)
tree62008e350c4f6048a68444fe50c47281643d276a /build/algorithm
parent962cb1040670977085f0a187ecc6730608578151 (diff)
Redo rule match/build logic
Now the rule is fully responsible for searching, matching, and building of prerequisites.
Diffstat (limited to 'build/algorithm')
-rw-r--r--build/algorithm46
1 files changed, 44 insertions, 2 deletions
diff --git a/build/algorithm b/build/algorithm
index a3b0db9..82913ad 100644
--- a/build/algorithm
+++ b/build/algorithm
@@ -5,16 +5,58 @@
#ifndef BUILD_ALGORITHM
#define BUILD_ALGORITHM
+#include <build/target>
+#include <build/timestamp>
+
namespace build
{
- class target;
class prerequisite;
+ // The default prerequsite search implementation. It first calls the
+ // target-type-specific search function. If that doesn't yeld anything,
+ // it creates a new target.
+ //
target&
search (prerequisite&);
- bool
+ // Match a rule to the target with ambiguity detection.
+ //
+ void
match (target&);
+
+ // The default prerequisite search and match implementation. It calls
+ // search() and then match() for each prerequisite in a loop.
+ //
+ void
+ search_and_match (target&);
+
+ target_state
+ update (target&);
+
+ // The default prerequisite update implementation. It calls update()
+ // for each prerequisite in a loop. Returns target_state::updated
+ // if any of them were updated and target_state::uptodate otherwise.
+ //
+ target_state
+ update_prerequisites (target&);
+
+ // A version of the above that also determines whether the target
+ // needs updating based on the passed timestamp.
+ //
+ bool
+ update_prerequisites (target&, const timestamp&);
+
+ // Another version of the above that does two extra things for the
+ // caller: it determines whether the target needs updating based
+ // on the passed timestamp and, if so, finds a prerequisite of the
+ // specified type.
+ //
+ template <typename T>
+ T*
+ update_prerequisites (target&, const timestamp&);
}
+#include <build/algorithm.ixx>
+#include <build/algorithm.txx>
+
#endif // BUILD_ALGORITHM