![]() |
Bitcoin ABC 0.31.0
P2P Digital Currency
|
MainSignalsImpl manages a list of shared_ptr<CValidationInterface> callbacks. More...
Classes | |
struct | ListEntry |
List entries consist of a callback pointer and reference count. More... | |
Public Member Functions | |
MainSignalsImpl (CScheduler &scheduler LIFETIMEBOUND) | |
void | Register (std::shared_ptr< CValidationInterface > callbacks) EXCLUSIVE_LOCKS_REQUIRED(!m_mutex) |
void | Unregister (CValidationInterface *callbacks) EXCLUSIVE_LOCKS_REQUIRED(!m_mutex) |
void | Clear () EXCLUSIVE_LOCKS_REQUIRED(!m_mutex) |
Clear unregisters every previously registered callback, erasing every map entry. More... | |
template<typename F > | |
void | Iterate (F &&f) EXCLUSIVE_LOCKS_REQUIRED(!m_mutex) |
Public Attributes | |
SingleThreadedSchedulerClient | m_schedulerClient |
Private Member Functions | |
std::list< ListEntry > m_list | GUARDED_BY (m_mutex) |
std::unordered_map< CValidationInterface *, std::list< ListEntry >::iterator > m_map | GUARDED_BY (m_mutex) |
Private Attributes | |
Mutex | m_mutex |
MainSignalsImpl manages a list of shared_ptr<CValidationInterface> callbacks.
A std::unordered_map is used to track what callbacks are currently registered, and a std::list is used to store the callbacks that are currently registered as well as any callbacks that are just unregistered and about to be deleted when they are done executing.
Definition at line 33 of file validationinterface.cpp.
|
inlineexplicit |
Definition at line 54 of file validationinterface.cpp.
|
inline |
Clear unregisters every previously registered callback, erasing every map entry.
After this call, the list may still contain callbacks that are currently executing, but it will be cleared when they are done executing.
Definition at line 83 of file validationinterface.cpp.
|
private |
|
inline |
Definition at line 94 of file validationinterface.cpp.
|
inline |
Definition at line 57 of file validationinterface.cpp.
|
inline |
Definition at line 67 of file validationinterface.cpp.
|
private |
Definition at line 35 of file validationinterface.cpp.
SingleThreadedSchedulerClient MainSignalsImpl::m_schedulerClient |
Definition at line 52 of file validationinterface.cpp.