Lines Matching refs:T
50 template <typename T>
51 class PollCopyVariable : public Variable<T> {
59 const T& ref, in PollCopyVariable()
62 : Variable<T>(name, kVariableModePoll), in PollCopyVariable()
66 PollCopyVariable(const std::string& name, const T& ref, const bool* is_set_p) in PollCopyVariable()
68 PollCopyVariable(const std::string& name, const T& ref) in PollCopyVariable()
73 const T& ref, in PollCopyVariable()
76 : Variable<T>(name, poll_interval), in PollCopyVariable()
82 const T& ref, in PollCopyVariable()
87 const T& ref) in PollCopyVariable()
95 inline const T* GetValue(base::TimeDelta /* timeout */, in GetValue()
106 return new T(ref_); in GetValue()
111 const T& ref_;
123 template <typename T>
124 class ConstCopyVariable : public Variable<T> {
129 ConstCopyVariable(const std::string& name, const T& obj) in ConstCopyVariable()
130 : Variable<T>(name, kVariableModeConst), obj_(obj) {} in ConstCopyVariable()
134 const T* GetValue(base::TimeDelta /* timeout */, in GetValue()
136 return new T(obj_); in GetValue()
141 const T obj_;
146 template <typename T>
147 class CallCopyVariable : public Variable<T> {
149 CallCopyVariable(const std::string& name, base::Callback<T(void)> func) in CallCopyVariable()
150 : Variable<T>(name, kVariableModePoll), func_(func) {} in CallCopyVariable()
153 base::Callback<T(void)> func) in CallCopyVariable()
154 : Variable<T>(name, poll_interval), func_(func) {} in CallCopyVariable()
158 const T* GetValue(base::TimeDelta /* timeout */, in GetValue()
162 return new T(func_.Run()); in GetValue()
169 base::Callback<T(void)> func_;
181 template <typename T>
182 class AsyncCopyVariable : public Variable<T> {
185 : Variable<T>(name, kVariableModeAsync), has_value_(false) {} in AsyncCopyVariable()
187 AsyncCopyVariable(const std::string& name, const T value) in AsyncCopyVariable()
188 : Variable<T>(name, kVariableModeAsync), in AsyncCopyVariable()
192 void SetValue(const T& new_value) { in SetValue()
209 const T* GetValue(base::TimeDelta /* timeout */, in GetValue()
216 return new T(value_); in GetValue()
224 T value_;