|
KiCad PCB EDA Suite
|
#include <observable.h>
Public Member Functions | |
| OBSERVABLE () | |
| Construct an observable with empty non-shared subscription list. | |
| OBSERVABLE (OBSERVABLE &aInherit) | |
| Construct an observable with a shared subscription list. | |
| void | SubscribeUnmanaged (ObserverInterface *aObserver) |
| Add a subscription without RAII link. | |
| LINK | Subscribe (ObserverInterface *aObserver) |
| Add a subscription returning an RAII link. | |
| void | Unsubscribe (ObserverInterface *aObserver) |
| Cancel the subscription of a subscriber. | |
| template<typename... Args1, typename... Args2> | |
| void | Notify (void(ObserverInterface::*Ptr)(Args1...), Args2 &&... aArgs) |
| Notify event to all subscribed observers. | |
| template<typename... Args1, typename... Args2> | |
| void | NotifyIgnore (void(ObserverInterface::*Ptr)(Args1...), ObserverInterface *aIgnore, Args2 &&... aArgs) |
| Notify event to all subscribed observers but one to be ignore. | |
| size_t | size () const |
Protected Member Functions | |
| void | on_observers_empty () |
| void | enter_iteration () |
| void | leave_iteration () |
| void | add_observer (void *observer) |
| void | remove_observer (void *observer) |
Protected Attributes | |
| std::shared_ptr< IMPL > | impl_ |
Private Member Functions | |
| void | allocate_impl () |
| void | allocate_shared_impl () |
| void | deallocate_impl () |
| std::shared_ptr< IMPL > | get_shared_impl () |
Definition at line 126 of file observable.h.
|
inline |
Construct an observable with empty non-shared subscription list.
Definition at line 132 of file observable.h.
Referenced by OBSERVABLE().
|
inline |
Construct an observable with a shared subscription list.
| aInherit | Observable to share the subscription list with. |
Definition at line 139 of file observable.h.
References OBSERVABLE(), and UTIL::DETAIL::OBSERVABLE_BASE::OBSERVABLE_BASE().
|
protectedinherited |
Definition at line 216 of file observable.cpp.
References allocate_impl(), and impl_.
|
privateinherited |
|
privateinherited |
|
privateinherited |
Definition at line 204 of file observable.cpp.
References impl_.
Referenced by on_observers_empty().
|
protectedinherited |
Definition at line 230 of file observable.cpp.
References impl_.
Referenced by UTIL::OBSERVABLE< ObserverInterface >::Notify(), and UTIL::OBSERVABLE< ObserverInterface >::NotifyIgnore().
|
privateinherited |
Definition at line 209 of file observable.cpp.
References allocate_shared_impl(), and impl_.
Referenced by OBSERVABLE_BASE().
|
protectedinherited |
Definition at line 237 of file observable.cpp.
References impl_.
Referenced by UTIL::OBSERVABLE< ObserverInterface >::Notify(), and UTIL::OBSERVABLE< ObserverInterface >::NotifyIgnore().
|
inline |
Notify event to all subscribed observers.
| Ptr | is a pointer to method of the observer interface. |
| aArgs | is a list of arguments to each notification call, will be perfectly forwarded. |
Definition at line 182 of file observable.h.
References UTIL::DETAIL::OBSERVABLE_BASE::enter_iteration(), UTIL::DETAIL::OBSERVABLE_BASE::impl_, and UTIL::DETAIL::OBSERVABLE_BASE::leave_iteration().
|
inline |
Notify event to all subscribed observers but one to be ignore.
| Ptr | is a pointer to method of the observer interface. |
| aIgnore | is an observer to ignore during this notification. |
| aArgs | is a list of arguments to each notification call, will be perfectly forwarded. |
Definition at line 218 of file observable.h.
References UTIL::DETAIL::OBSERVABLE_BASE::enter_iteration(), UTIL::DETAIL::OBSERVABLE_BASE::impl_, and UTIL::DETAIL::OBSERVABLE_BASE::leave_iteration().
|
protectedinherited |
Definition at line 258 of file observable.cpp.
References deallocate_impl().
|
protectedinherited |
Definition at line 223 of file observable.cpp.
References impl_.
|
inherited |
Definition at line 249 of file observable.cpp.
References impl_.
|
inline |
Add a subscription returning an RAII link.
| aObserver | observer to subscribe |
Definition at line 157 of file observable.h.
References UTIL::DETAIL::OBSERVABLE_BASE::impl_, and UTIL::DETAIL::OBSERVABLE_BASE::UTIL::LINK.
|
inline |
Add a subscription without RAII link.
| aObserver | Observer to subscribe. |
Definition at line 146 of file observable.h.
|
inline |
Cancel the subscription of a subscriber.
This can be called during notification calls.
| aObserver | observer to remove from the subscription list. |
Definition at line 170 of file observable.h.
|
protectedinherited |
Definition at line 93 of file observable.h.
Referenced by add_observer(), allocate_impl(), allocate_shared_impl(), deallocate_impl(), enter_iteration(), get_shared_impl(), leave_iteration(), UTIL::OBSERVABLE< ObserverInterface >::Notify(), UTIL::OBSERVABLE< ObserverInterface >::NotifyIgnore(), OBSERVABLE_BASE(), remove_observer(), size(), and UTIL::OBSERVABLE< ObserverInterface >::Subscribe().