aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/context.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'libbuild2/context.hxx')
-rw-r--r--libbuild2/context.hxx17
1 files changed, 13 insertions, 4 deletions
diff --git a/libbuild2/context.hxx b/libbuild2/context.hxx
index c040927..35ba11d 100644
--- a/libbuild2/context.hxx
+++ b/libbuild2/context.hxx
@@ -211,9 +211,11 @@ namespace build2
unique_ptr<data> data_;
public:
- scheduler& sched;
- global_mutexes& mutexes;
- file_cache& fcache;
+ // These are only NULL for the "bare minimum" context (see below).
+ //
+ scheduler* sched;
+ global_mutexes* mutexes;
+ file_cache* fcache;
// Match only flag (see --match-only but also dist).
//
@@ -677,7 +679,6 @@ namespace build2
reserves (size_t t, size_t v): targets (t), variables (v) {}
};
- explicit
context (scheduler&,
global_mutexes&,
file_cache&,
@@ -691,6 +692,14 @@ namespace build2
optional<context*> module_context = nullptr,
const loaded_modules_lock* inherited_mudules_lock = nullptr);
+ // Special context with bare minimum of initializations. It is only
+ // guaranteed to be sufficiently initialized to call extract_variable().
+ //
+ // Note that for this purpose you may omit calls to init_diag() and
+ // init().
+ //
+ context ();
+
// Reserve elements in containers to avoid re-allocation/re-hashing. Zero
// values are ignored (that is, the corresponding container reserve()
// function is not called). Can only be called in the load phase.