![]() |
Workspace 6.21.5
|
Generalized observer used primarily by the templated ObserverSet::add() implementation. More...
#include <Workspace/DataExecution/Events/generalobserver.h>
Public Types | |
using | MemberFunc = typename DataExecutionPrivate::EventProcessor< SenderEventType, ReceiverEventType, ReceiverType, ReceiverOrBaseType, ReturnType >::MemberFunc |
![]() | |
using | MemberFunc = typename Processor::MemberFunc |
using | Processor = DataExecutionPrivate::EventProcessor< SenderEventType, ReceiverEventType, ReceiverType, ReceiverOrBaseType, ReturnType > |
Public Member Functions | |
GeneralObserver (Observable &sender, const EventIDSingleton< SenderEventType > &eventId, ReceiverType &receiver, MemberFunc func) | |
virtual void | update (const ObservableEvent &e) |
![]() | |
void | destroy () |
const EventID & | getEventID () const |
void | moveToThread (QThread *thread) |
virtual void | update (const ObservableEvent &event) |
Related Functions | |
(Note that these are not member functions.) | |
enum | ObserverThreadType |
Additional Inherited Members | |
![]() | |
ObserverType (Observable &sender, const EventIDSingleton< SenderEventType > &eventId, ReceiverType &receiver, typename Processor::MemberFunc func) | |
void | processEvent (const ObservableEvent &e) |
![]() | |
Observer (const Observer &) | |
Observer (Observable &subject, const EventID &eventID, bool ownedBySubject=false, bool attach=true) | |
virtual | ~Observer () |
bool | isOwnedBySubject () const |
void | setOwnedBySubject (bool ownedBySubject) const |
virtual bool | updateInNotificationThread (const ObservableEvent &event) |
virtual void | updateInObserverThread (const ObservableEvent &event) |
This class is not designed to be used directly (although this would be legal). It is far easier to use an ObserverSet and to call one of its add() templated member functions, since this will create a GeneralObserver with appropriate template arguments by automatically deducing them from the types of the arguments supplied to add().
The default implementation of this template is for an unthreaded observer, which means the notification and receiving threads must always be the same. An assertion checks this condition. There are specializations for threaded and thread-safe observers. For release builds, an unthreaded and a thread-safe observer have the same implementation - the only difference is that the unthreaded observer has the assertion for debug builds and it holds an extra pointer data member for the validation.
using MemberFunc = typename DataExecutionPrivate::EventProcessor<SenderEventType, ReceiverEventType, ReceiverType, ReceiverOrBaseType, ReturnType>::MemberFunc |
|
inline |
|
inlinevirtual |
Reimplemented from Observer.
|
related |