PolicyManager: Add a Variable "Mode" property.
There are three kinds of Variables: Const, Poll and Async; that
reflect how the value on the variable changes. Const variables don't
change its value, Poll variables can change the value without notice
and Async variables can change the value but notify the observers
with those changes.
This patch adds the Mode property to the BaseVariable class. This
property can be used by the EvaluationContext to determine how to
treat a given variable.
BUG=chromium:341209
TEST=unit test added and passing.
Change-Id: Ifd4ebcfb84cdb9c6cca1ccbb34004cbac0ea2d2f
Reviewed-on: https://chromium-review.googlesource.com/187240
Reviewed-by: Alex Deymo <deymo@chromium.org>
Commit-Queue: Alex Deymo <deymo@chromium.org>
Tested-by: Alex Deymo <deymo@chromium.org>
diff --git a/policy_manager/generic_variables.h b/policy_manager/generic_variables.h
index 050fca5..7f76981 100644
--- a/policy_manager/generic_variables.h
+++ b/policy_manager/generic_variables.h
@@ -37,8 +37,8 @@
// Creates the variable returning copies of the passed |obj| reference. The
// reference to this object is kept and it should be available whenever the
// GetValue() method is called.
- CopyVariable(const std::string& name, const T& ref)
- : Variable<T>(name), ref_(ref) {}
+ CopyVariable(const std::string& name, VariableMode mode, const T& ref)
+ : Variable<T>(name, mode), ref_(ref) {}
protected:
friend class PmCopyVariableTest;