From 93dbdacafb07b674467aa30c4aefd38bb3871601 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 26 Jan 2017 16:01:58 +0200 Subject: Add scheduling calls to operation's match() --- build2/variable | 45 +++++++++++++++++++++++++++++---------------- 1 file changed, 29 insertions(+), 16 deletions(-) (limited to 'build2/variable') 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, + 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 pool. // // Protected by the model mutex. @@ -841,10 +865,6 @@ namespace build2 rw (scope&) const {return const_cast (*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, 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, - variable_override_value>; } #include -- cgit v1.1