template<typename T>
class anch::events::ObserverList< T >
Thread safe observers list (internal usage).
List shared by Observable and EventBus.
Notifications are done without lock on a snapshot of the list (copy on write) so observers can add or remove observers, or notify again, from their handle method.
Guarantees:
- an observer removed during a notification is not notified anymore by this notification ;
- when remove returns, the observer will not be notified anymore by any thread and can be destroyed. remove waits for notifications running in other threads. Called from a
handle method (current thread is notifying this list), it does not wait for the current thread notifications.
Observers are notified in their registration order.
- Since
- 0.1
- Author
- Vincent Lachenal