Lines Matching refs:T
50 template<typename T>
51 class PollCopyVariable : public Variable<T> {
58 PollCopyVariable(const std::string& name, const T& ref, const bool* is_set_p, in PollCopyVariable()
60 : Variable<T>(name, kVariableModePoll), ref_(ref), is_set_p_(is_set_p), in PollCopyVariable()
62 PollCopyVariable(const std::string& name, const T& ref, const bool* is_set_p) in PollCopyVariable()
64 PollCopyVariable(const std::string& name, const T& ref) in PollCopyVariable()
68 const T& ref, const bool* is_set_p, in PollCopyVariable()
70 : Variable<T>(name, poll_interval), ref_(ref), is_set_p_(is_set_p), in PollCopyVariable()
73 const T& ref, const bool* is_set_p) in PollCopyVariable()
76 const T& ref) in PollCopyVariable()
84 inline const T* GetValue(base::TimeDelta /* timeout */, in GetValue()
95 return new T(ref_); in GetValue()
100 const T& ref_;
112 template<typename T>
113 class ConstCopyVariable : public Variable<T> {
118 ConstCopyVariable(const std::string& name, const T& obj) in ConstCopyVariable()
119 : Variable<T>(name, kVariableModeConst), obj_(obj) {} in ConstCopyVariable()
123 const T* GetValue(base::TimeDelta /* timeout */, in GetValue()
125 return new T(obj_); in GetValue()
130 const T obj_;
135 template<typename T>
136 class CallCopyVariable : public Variable<T> {
138 CallCopyVariable(const std::string& name, base::Callback<T(void)> func) in CallCopyVariable()
139 : Variable<T>(name, kVariableModePoll), func_(func) {} in CallCopyVariable()
142 base::Callback<T(void)> func) in CallCopyVariable()
143 : Variable<T>(name, poll_interval), func_(func) {} in CallCopyVariable()
147 const T* GetValue(base::TimeDelta /* timeout */, in GetValue()
151 return new T(func_.Run()); in GetValue()
158 base::Callback<T(void)> func_;
171 template<typename T>
172 class AsyncCopyVariable : public Variable<T> {
175 : Variable<T>(name, kVariableModeAsync), has_value_(false) {} in AsyncCopyVariable()
177 AsyncCopyVariable(const std::string& name, const T value) in AsyncCopyVariable()
178 : Variable<T>(name, kVariableModeAsync), in AsyncCopyVariable()
181 void SetValue(const T& new_value) { in SetValue()
198 const T* GetValue(base::TimeDelta /* timeout */, in GetValue()
205 return new T(value_); in GetValue()
213 T value_;