From 5fec6c87511cacfd9561664a652f8f1b679adcce Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 19 Oct 2022 05:45:32 +0200 Subject: Take 1: match/execute as part of target (dead end) --- libbuild2/algorithm.hxx | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'libbuild2/algorithm.hxx') diff --git a/libbuild2/algorithm.hxx b/libbuild2/algorithm.hxx index e558d3a..a3d785e 100644 --- a/libbuild2/algorithm.hxx +++ b/libbuild2/algorithm.hxx @@ -195,6 +195,8 @@ namespace build2 explicit operator bool () const {return target != nullptr;} + // Note: achieved offset is preserved. + // void unlock (); @@ -374,6 +376,12 @@ namespace build2 pair match_sync (action, const target&, unmatch); + // As above but without incrementing the target's dependents count. Should + // be executed with execute_direct_*(). + // + target_state + match_direct_sync (action, const target&, bool fail = true); + // Start asynchronous match. Return target_state::postponed if the // asynchronous operation has been started and target_state::busy if the // target has already been busy. Regardless of the result, match_complete() @@ -486,11 +494,11 @@ namespace build2 // target pointers are skipped. // LIBBUILD2_SYMEXPORT void - match_members (action, target&, const target* const*, size_t); + match_members (action, const target&, const target* const*, size_t); template inline void - match_members (action a, target& t, const target* (&ts)[N]) + match_members (action a, const target& t, const target* (&ts)[N]) { match_members (a, t, ts, N); } @@ -501,7 +509,7 @@ namespace build2 // LIBBUILD2_SYMEXPORT void match_members (action a, - target& t, + const target& t, prerequisite_targets& ts, size_t start = 0, pair include = {0, 0}); @@ -795,8 +803,9 @@ namespace build2 // Call straight or reverse depending on the current mode. // + template target_state - execute_members (action, const target&, const target*[], size_t); + execute_members (action, const target&, T[], size_t); template inline target_state -- cgit v1.1