|
TVM
0.9.4
|
#include <tvm/internal/CallbackManager.h>
Public Types | |
| using | Callback = std::function< void()> |
| using | TCPair = std::pair< PairElementToken, Callback > |
Public Member Functions | |
| CallbackManager ()=default | |
| CallbackManager (const CallbackManager &)=delete | |
| CallbackManager & | operator= (const CallbackManager &)=delete |
| virtual | ~CallbackManager ()=default |
| PairElementTokenHandle | registerCallback (std::function< void()> c) |
| void | unregisterCallback (const PairElementToken &t) |
| void | run () |
A class to register and run callbacks, based on PairElementToken to identify the class who registered the callback and check if it is still alive. If this class was destroyed, the callback is automatically unregistered.
| using tvm::internal::CallbackManager::Callback = std::function<void()> |
| using tvm::internal::CallbackManager::TCPair = std::pair<PairElementToken, Callback> |
|
default |
|
delete |
|
virtualdefault |
|
delete |
|
inline |
Register a callback and return a handle that needs to be converted to PairElementToken.
|
inline |
Run all callbacks. Remove the ones for which the token obtained at the registration was destroyed.
|
inline |
Unregister a callback, identified by the token created from its registration.