![]() |
User Manual, Developers Guide and API Documentation |
![]() |
#include <Subject.hpp>
Inherits wns::SubjectInterface< OBSERVERINTERFACE >< wns::ObserverInterface< NOTIFICATIONINTERFACE > >.
Inherited by lte::controlplane::MapHandler, lte::timing::TimingScheduler, lte::timing::TimingScheduler, ofdmaphy::receiver::Receiver, wifimac::convergence::ChannelStateNotification [virtual], wifimac::convergence::NAVNotification [virtual], wifimac::convergence::RxStartEndNotification [virtual], wifimac::convergence::TxStartEndNotification [virtual], wifimac::management::LinkNotificator [virtual], wimac::service::ConnectionManager, wimemac::convergence::ChannelStateNotification [virtual], wimemac::convergence::NAVNotification [virtual], wimemac::convergence::RxStartEndNotification [virtual], wimemac::convergence::TxStartEndNotification [virtual], wns::events::scheduler::Map, wns::Positionable, wns::probe::bus::detail::SubjectPimpl, wns::service::phy::copper::DataTransmissionFeedback [virtual], wns::service::phy::copper::Notification [virtual], and wns::service::phy::copper::Notification [virtual].

Public Types | |
| typedef NOTIFICATIONINTERFACE | NotificationInterface |
| The NotificationInterface used by Subject. | |
| typedef ObserverInterface < NotificationInterface > | ObserverType |
| The ObserverInterface using the same NotificationInterface. | |
| typedef SubjectInterface < ObserverType > | SubjectType |
| Our interface. | |
Public Member Functions | |
| template<typename FUNCTOR> | |
| FUNCTOR | forEachObserver (const FUNCTOR &functor) |
| Execute functor on each observer. | |
| template<typename FUNCTOR> | |
| FUNCTOR | forEachObserverNoDetachAllowed (const FUNCTOR &functor) |
| Execute functor on each of the originals observers. | |
| bool | hasObservers () const |
| Subject & | operator= (const Subject &other) |
| Remove own observers, connect to others obsevers. | |
| template<typename NOTIFICATIONFUNCTIONPTR, typename ARG> | |
| void | sendNotifies (const NOTIFICATIONFUNCTIONPTR notificationFunctionPtr, const ARG &arg) |
| Notify all observers via notificattionFunctionPtr and one argument. | |
| template<typename NOTIFICATIONFUNCTIONPTR> | |
| void | sendNotifies (const NOTIFICATIONFUNCTIONPTR notificationFunctionPtr) |
| Notify all observers via notificattionFunctionPtr. | |
| Subject (const Subject &other) | |
| copy constructor | |
| Subject () | |
| Default constructor. | |
| virtual | ~Subject () |
| Removes itself from every attached Observer. | |
Protected Types | |
| typedef std::list< ObserverType * > | ObserverContainer |
Private Member Functions | |
| virtual void | addObserver (ObserverType *observer) |
| virtual void | removeObserver (ObserverType *observer) |
Private Attributes | |
| bool | modificationGuard_ |
| ObserverContainer | observers |
| The observer collection. | |
| NOTIFICATIONINTERFACE | The notification interface of the observers. |
Derivers can notify all observers with sendNotifies() and perform operations on all observer with forEachObserver().
Definition at line 68 of file Subject.hpp.
| typedef NOTIFICATIONINTERFACE wns::Subject< NOTIFICATIONINTERFACE >::NotificationInterface |
The NotificationInterface used by Subject.
Definition at line 77 of file Subject.hpp.
typedef std::list<ObserverType*> wns::Subject< NOTIFICATIONINTERFACE >::ObserverContainer [protected] |
Definition at line 242 of file Subject.hpp.
| typedef ObserverInterface<NotificationInterface> wns::Subject< NOTIFICATIONINTERFACE >::ObserverType |
The corresponding ObserverInterface that uses the same NotificationInterface.
Reimplemented from wns::SubjectInterface< OBSERVERINTERFACE >.
Definition at line 84 of file Subject.hpp.
| typedef SubjectInterface<ObserverType> wns::Subject< NOTIFICATIONINTERFACE >::SubjectType |
The interface that this Subject implements.
Reimplemented in wns::Positionable.
Definition at line 91 of file Subject.hpp.
| wns::Subject< NOTIFICATIONINTERFACE >::Subject | ( | ) | [inline] |
Definition at line 96 of file Subject.hpp.
| wns::Subject< NOTIFICATIONINTERFACE >::Subject | ( | const Subject< NOTIFICATIONINTERFACE > & | other | ) | [inline] |
Definition at line 105 of file Subject.hpp.
| virtual wns::Subject< NOTIFICATIONINTERFACE >::~Subject | ( | ) | [inline, virtual] |
Informs every attached observer that it is no longer attached to this Subject instance via ObserverInterface::removeSubject().
Definition at line 148 of file Subject.hpp.
| virtual void wns::Subject< NOTIFICATIONINTERFACE >::addObserver | ( | ObserverType * | observer | ) | [inline, private, virtual] |
Add an observer to a subject.
| observer | The observer to add. |
All attached observers will be addressed by sendNotifies() and forEachObserver(), and they will be informed of the destruction of this Subject instance via ObserverInterface::removeSubject().
Definition at line 253 of file Subject.hpp.
| FUNCTOR wns::Subject< NOTIFICATIONINTERFACE >::forEachObserver | ( | const FUNCTOR & | functor | ) | [inline] |
| functor | The function to perform an each observer. |
Definition at line 202 of file Subject.hpp.
| FUNCTOR wns::Subject< NOTIFICATIONINTERFACE >::forEachObserverNoDetachAllowed | ( | const FUNCTOR & | functor | ) | [inline] |
| functor | The function to perform an each observer. |
Definition at line 224 of file Subject.hpp.
| bool wns::Subject< NOTIFICATIONINTERFACE >::hasObservers | ( | ) | const [inline] |
Definition at line 235 of file Subject.hpp.
| Subject& wns::Subject< NOTIFICATIONINTERFACE >::operator= | ( | const Subject< NOTIFICATIONINTERFACE > & | other | ) | [inline] |
Definition at line 120 of file Subject.hpp.
| virtual void wns::Subject< NOTIFICATIONINTERFACE >::removeObserver | ( | ObserverType * | observer | ) | [inline, private, virtual] |
Remove an observer from a subject.
| observer | The observer to remove. |
Definition at line 270 of file Subject.hpp.
| void wns::Subject< NOTIFICATIONINTERFACE >::sendNotifies | ( | const NOTIFICATIONFUNCTIONPTR | notificationFunctionPtr, | |
| const ARG & | arg | |||
| ) | [inline] |
| notificationFunctionPtr | A pointer to a member function of NotificationInterface that receives one argument. | |
| arg | The argument to pass to each observer via the call of the member function referenced by notificationFunctionPtr. |
Definition at line 187 of file Subject.hpp.
| void wns::Subject< NOTIFICATIONINTERFACE >::sendNotifies | ( | const NOTIFICATIONFUNCTIONPTR | notificationFunctionPtr | ) | [inline] |
| notificationFunctionPtr | A pointer to a member function of NotificationInterface that receives no arguments. |
Definition at line 168 of file Subject.hpp.
bool wns::Subject< NOTIFICATIONINTERFACE >::modificationGuard_ [private] |
Definition at line 291 of file Subject.hpp.
ObserverContainer wns::Subject< NOTIFICATIONINTERFACE >::observers [private] |
The observer collection.
Definition at line 290 of file Subject.hpp.
1.5.5