Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
observable< TObserver, MAX_OBSERVERS > Class Template Reference
[observer]
The object that is being observed. More...
#include <observer.h>
Public Member Functions | |
| void | add_observer (TObserver &observer) |
| Add an observer to the list. | |
| void | remove_observer (TObserver &observer) |
| Remove a particular observer from the list. | |
| void | clear_observers () |
| Clear all observers from the list. | |
| size_type | number_of_observers () const |
| Returns the number of observers. | |
| template<typename TNotification > | |
| void | notify_observers (TNotification n) |
| Notify all of the observers, sending them the notification. | |
Detailed Description
template<typename TObserver, const size_t MAX_OBSERVERS>
class etl::observable< TObserver, MAX_OBSERVERS >
The object that is being observed.
- Template Parameters:
-
TObserver The observer type. MAX_OBSERVERS The maximum number of observers that can be accomodated.
Definition at line 101 of file observer.h.
Member Function Documentation
| void add_observer | ( | TObserver & | observer ) |
Add an observer to the list.
If asserts or exceptions are enabled then an etl::observable_observer_list_full is emitted if the observer list is already full.
- Parameters:
-
observer A reference to the observer.
Definition at line 115 of file observer.h.
| void clear_observers | ( | ) |
Clear all observers from the list.
Definition at line 155 of file observer.h.
| void notify_observers | ( | TNotification | n ) |
Notify all of the observers, sending them the notification.
- Template Parameters:
-
TNotification the notification type.
- Parameters:
-
n The notification.
Definition at line 174 of file observer.h.
| size_type number_of_observers | ( | ) | const |
Returns the number of observers.
Definition at line 163 of file observer.h.
| void remove_observer | ( | TObserver & | observer ) |
Remove a particular observer from the list.
- Parameters:
-
observer A reference to the observer.
Definition at line 137 of file observer.h.
Generated on Tue Jul 12 2022 14:05:52 by
1.7.2