aboutsummaryrefslogtreecommitdiff
path: root/build2/variable
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-01-26 16:01:58 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-02-13 12:42:33 +0200
commit93dbdacafb07b674467aa30c4aefd38bb3871601 (patch)
tree6675150a587b560193ef21ae1d334300655e9d8e /build2/variable
parent88f0780e34116c0441a8d8c58b8a8fd9fde4b1f5 (diff)
Add scheduling calls to operation's match()
Diffstat (limited to 'build2/variable')
-rw-r--r--build2/variable45
1 files changed, 29 insertions, 16 deletions
diff --git a/build2/variable b/build2/variable
index 4377d7b..e296e37 100644
--- a/build2/variable
+++ b/build2/variable
@@ -755,6 +755,30 @@ namespace build2
static const value_type_ex value_type;
};
+ // Variable override cache.
+ //
+ struct variable_override_value
+ {
+ build2::value value;
+ const variable_map* stem_vars = nullptr; // NULL means there is no stem.
+ };
+
+ using variable_override_cache = std::map<pair<const variable_map*,
+ const variable*>,
+ variable_override_value>;
+
+ // Project-wide (as opposed to global) variable overrides. Returned by
+ // context.cxx:reset().
+ //
+ struct variable_override
+ {
+ const variable& var; // Original variable.
+ const variable& ovr; // Override variable.
+ value val;
+ };
+
+ using variable_overrides = vector<variable_override>;
+
// Variable pool.
//
// Protected by the model mutex.
@@ -841,10 +865,6 @@ namespace build2
rw (scope&) const {return const_cast<variable_pool&> (*this);}
private:
- // Classes that can access bypassing the lock.
- //
- friend class scope;
-
static variable_pool instance;
const variable&
@@ -853,6 +873,11 @@ namespace build2
const variable_visibility* = nullptr,
const bool* overridable = nullptr);
+ // Entities that can access bypassing the lock.
+ //
+ friend class scope;
+ friend variable_overrides reset (const strings&);
+
public:
static const variable_pool& cinstance; // For var_pool initialization.
@@ -1034,18 +1059,6 @@ namespace build2
mutable
std::map<tuple<const value*, const target_type*, string>, value> cache;
};
-
- // Override cache.
- //
- struct variable_override_value
- {
- build2::value value;
- const variable_map* stem_vars = nullptr; // NULL means there is no stem.
- };
-
- using variable_override_cache = std::map<pair<const variable_map*,
- const variable*>,
- variable_override_value>;
}
#include <build2/variable.ixx>