|
AGX Dynamics 2.41.3.0
|
Generalized callback, using std::function. More...
#include <Callback.h>
Inheritance diagram for agx::Callback:Public Types | |
| typedef std::function< void()> | CallbackFunction |
Public Member Functions | |
| Callback () | |
| Callback (const CallbackFunction &func, bool repeatEnable=true) | |
| template<class ClassT > | |
| Callback (void(ClassT::*fun)(), ClassT *obj, bool repeatEnable=true) | |
| const CallbackFunction & | implementation () const |
| Return the std representation. | |
| bool | isRepeating () const |
| bool | isValid () const |
| operator bool () const | |
| operator const CallbackFunction & () const | |
| void | operator() () const |
| Execute the callback. | |
| void | run () const |
Generalized callback, using std::function.
Example:
class Foo { public: void Foo() { Callback callback(&Foo::bar, this); callback(); // Will print 'bar called' }
void bar() { printf("bar called\n"); } };
Definition at line 53 of file Callback.h.
| typedef std::function<void ()> agx::Callback::CallbackFunction |
Definition at line 56 of file Callback.h.
| agx::Callback::Callback | ( | ) |
Definition at line 268 of file Callback.h.
| agx::Callback::Callback | ( | const CallbackFunction & | func, |
| bool | repeatEnable = true |
||
| ) |
| func | - Callback function |
| repeatEnable | - Is repeat enabled or not. |
Definition at line 269 of file Callback.h.
| agx::Callback::Callback | ( | void(ClassT::*)() | fun, |
| ClassT * | obj, | ||
| bool | repeatEnable = true |
||
| ) |
| obj | - |
| repeatEnable | - Is repeat enabled or not. |
Definition at line 264 of file Callback.h.
| const Callback::CallbackFunction & agx::Callback::implementation | ( | ) | const |
Return the std representation.
Definition at line 271 of file Callback.h.
| bool agx::Callback::isRepeating | ( | ) | const |
Definition at line 272 of file Callback.h.
Referenced by agx::Event::trigger().
| bool agx::Callback::isValid | ( | ) | const |
Definition at line 283 of file Callback.h.
| agx::Callback::operator bool | ( | ) | const |
Definition at line 284 of file Callback.h.
| agx::Callback::operator const Callback::CallbackFunction & | ( | ) | const |
Definition at line 282 of file Callback.h.
| void agx::Callback::operator() | ( | ) | const |
| void agx::Callback::run | ( | ) | const |
Definition at line 276 of file Callback.h.
References agxAssert.
Referenced by operator()(), and agx::Event::trigger().