Class maintains a list of its dependents, called observers, and notifies them automatically of any state changes.
More...
#include <observer.h>
|
observer_token | attach (observer_t *pObserver) noexcept |
| Attach observer to this subject. More...
|
|
void | notify (const notify_func ¬ifyFunc) const noexcept |
| Notify all observers. More...
|
|
iterator | begin () |
| Return iterator to beginning. More...
|
|
const_iterator | begin () const |
| Return iterator to beginning. More...
|
|
const_iterator | cbegin () const |
| Return const iterator to beginning. More...
|
|
iterator | end () |
| Return iterator to end. More...
|
|
const_iterator | end () const |
| Return iterator to end. More...
|
|
const_iterator | cend () const |
| Return const iterator to end. More...
|
|
reverse_iterator | rbegin () |
| Return reverse iterator to reverse beginning. More...
|
|
const_reverse_iterator | rbegin () const |
| Return reverse iterator to reverse beginning. More...
|
|
const_reverse_iterator | crbegin () const |
| Return const reverse iterator to reverse beginning. More...
|
|
reverse_iterator | rend () |
| Return reverse iterator to reverse end. More...
|
|
const_reverse_iterator | rend () const |
| Return reverse iterator to reverse end. More...
|
|
const_reverse_iterator | crend () const |
| Return const reverse iterator to reverse end. More...
|
|
size_t | get_num_observers () const noexcept |
| Get number of observers attached to this subject. More...
|
|
template<class observer_t>
class qx::subject< observer_t >
Class maintains a list of its dependents, called observers, and notifies them automatically of any state changes.
~
- Template Parameters
-
observer_t | - observer type |
- Author
- Khrapov
- Date
- 6.03.2021
Definition at line 119 of file observer.h.
◆ attach()
template<class observer_t >
observer_token qx::subject< observer_t >::attach |
( |
observer_t * |
pObserver | ) |
|
|
inlinenoexcept |
Attach observer to this subject.
- Parameters
-
pObserver | - observer pointer |
- Return values
-
- | observer_token for auto detaching observer from this subject |
Definition at line 159 of file observer.inl.
◆ begin() [1/2]
template<class observer_t >
Return iterator to beginning.
- Return values
-
Definition at line 182 of file observer.inl.
◆ begin() [2/2]
template<class observer_t >
const_iterator qx::subject< observer_t >::begin |
( |
| ) |
const |
Return iterator to beginning.
- Return values
-
◆ cbegin()
template<class observer_t >
Return const iterator to beginning.
- Return values
-
- | const iterator to beginning |
Definition at line 194 of file observer.inl.
◆ cend()
template<class observer_t >
Return const iterator to end.
- Return values
-
Definition at line 212 of file observer.inl.
◆ crbegin()
template<class observer_t >
Return const reverse iterator to reverse beginning.
- Return values
-
- | const reverse iterator to reverse beginning |
Definition at line 230 of file observer.inl.
◆ crend()
template<class observer_t >
Return const reverse iterator to reverse end.
- Return values
-
- | const reverse iterator to reverse end |
Definition at line 248 of file observer.inl.
◆ end() [1/2]
template<class observer_t >
Return iterator to end.
- Return values
-
Definition at line 200 of file observer.inl.
◆ end() [2/2]
template<class observer_t >
const_iterator qx::subject< observer_t >::end |
( |
| ) |
const |
Return iterator to end.
- Return values
-
◆ get_num_observers()
template<class observer_t >
Get number of observers attached to this subject.
- Return values
-
- | number of observers attached to this subject |
Definition at line 254 of file observer.inl.
◆ notify()
template<class observer_t >
void qx::subject< observer_t >::notify |
( |
const notify_func & |
notifyFunc | ) |
const |
|
inlinenoexcept |
Notify all observers.
- Parameters
-
Definition at line 175 of file observer.inl.
◆ rbegin() [1/2]
template<class observer_t >
Return reverse iterator to reverse beginning.
- Return values
-
- | reverse iterator to reverse beginning |
Definition at line 218 of file observer.inl.
◆ rbegin() [2/2]
template<class observer_t >
const_reverse_iterator qx::subject< observer_t >::rbegin |
( |
| ) |
const |
Return reverse iterator to reverse beginning.
- Return values
-
- | reverse iterator to reverse beginning |
◆ rend() [1/2]
template<class observer_t >
Return reverse iterator to reverse end.
- Return values
-
- | reverse iterator to reverse end |
Definition at line 236 of file observer.inl.
◆ rend() [2/2]
template<class observer_t >
const_reverse_iterator qx::subject< observer_t >::rend |
( |
| ) |
const |
Return reverse iterator to reverse end.
- Return values
-
- | reverse iterator to reverse end |
The documentation for this class was generated from the following files: