MCPcopy Create free account
hub / github.com/MyGUI/mygui / Delegate

Class Delegate

MyGUIEngine/include/MyGUI_Delegate.h:157–186  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

155
156 template<typename... Args>
157 class Delegate
158 {
159 public:
160 using IDelegate = DelegateFunction<Args...>;
161
162 bool empty() const
163 {
164 return !mDelegate;
165 }
166
167 void clear()
168 {
169 mDelegate.reset();
170 }
171
172 Delegate& operator=(IDelegate* _delegate)
173 {
174 mDelegate.reset(_delegate);
175 return *this;
176 }
177
178 void operator()(Args... args) const
179 {
180 if (mDelegate)
181 mDelegate->invoke(args...);
182 }
183
184 private:
185 std::unique_ptr<IDelegate> mDelegate;
186 };
187
188 template<typename... Args>
189 class MultiDelegate

Callers 1

registerFactoryMethod · 0.85

Calls 1

resetMethod · 0.45

Tested by

no test coverage detected