6#ifndef SWIFT_MISC_SHAREDSTATE_PASSIVEOBSERVER_H
7#define SWIFT_MISC_SHAREDSTATE_PASSIVEOBSERVER_H
11#include <QSharedPointer>
30 friend CActiveObserver;
33 template <
typename T,
typename F>
34 CPassiveObserver(T *
parent, F eventHandler)
36 m_eventHandler([=](
const CVariant ¶m) { private_ns::invokeMethod(
parent, eventHandler, param); })
41 template <
typename T,
typename F>
48 void setEventSubscription(
const CVariant ¶m);
54 void handleEvent(
const CVariant ¶m)
const;
64 const std::function<void(
const CVariant ¶m)> m_eventHandler;
66 mutable QMutex m_eventSubscriptionMutex;
Wrapper around QVariant which provides transparent access to CValueObject methods of the contained ob...
Extends CPassiveObserver with the ability to send requests and receive replies.
Dummy value class that matches any event.
bool matches(const CVariant &) const
Returns true.
QString convertToQString(bool=false) const
To string.
static auto create(T *parent, F eventHandler)
Factory method.
QWeakPointer< const CPassiveObserver > weakRef() const
Get a QWeakPointer pointing to this object.
void eventSubscriptionChanged(const swift::misc::CVariant ¶m)
Emitted by setEventSubscription.
Utilities for sharing state between multiple objects.
QSharedPointer< T > sharedFromThis()
QObject * parent() const const
QSharedPointer< T > create(Args &&... args)
#define SWIFT_MISC_EXPORT
Export a class or function from the library.
#define SWIFT_DECLARE_VALUEOBJECT_MIXINS(Namespace, Class)
Explicit template declaration of mixins for a CValueObject subclass to be placed near the top of the ...