Dobby 3.0
Dobby “Docker based Thingy” is a tool for managing and running OCI containers using crun
|
A template of observable objects that send notifications defined in interface T. More...
#include <Notifier.h>
Public Member Functions | |
void | addObserver (const std::shared_ptr< T > &observer) |
Register interest in receiving updates. | |
void | removeObserver (const std::shared_ptr< T > &observer) |
Unregister from updates. | |
void | setDispatcher (const std::shared_ptr< IDispatcher > &dispatcher_) |
Protected Member Functions | |
template<typename F , typename... Args> | |
void | notify (F f, Args &&... args) |
template<typename F > | |
void | notify (F f) |
Protected Attributes | |
std::shared_ptr< IDispatcher > | dispatcher |
Private Member Functions | |
void | notify_impl (std::function< void(const std::shared_ptr< T > &)> fun) |
Private Attributes | |
std::mutex | m |
std::deque< std::weak_ptr< T > > | observers |
std::condition_variable | cv |
bool | notifyingObservers |
unsigned int | waiteeCount |
A template of observable objects that send notifications defined in interface T.
|
inline |
Set dispatcher which will be used for notification callbacks.