6 #ifndef SWIFT_MISC_SHAREDSTATE_DATALINK_H
7 #define SWIFT_MISC_SHAREDSTATE_DATALINK_H
9 #include <QMetaClassInfo>
10 #include <QMetaObject>
12 #include <QStringBuilder>
27 #define SWIFT_SHARED_STATE_CHANNEL(ID) Q_CLASSINFO("SharedStateChannel", ID)
32 class CPassiveMutator;
34 class CPassiveObserver;
35 class CActiveObserver;
60 bool m_connected =
false;
96 static QString getChannelName(
const QObject *
object);
104 Q_DECLARE_METATYPE(swift::misc::CPromise<swift::misc::CVariant>)
Extends CPassiveMutator with the ability to respond to requests.
Extends CPassiveObserver with the ability to send requests and receive replies.
Observe the connection state of an IDataLink.
bool isConnected() const
True if connected to the transport layer.
void connected()
Connection established.
void disconnected()
Connection dropped.
Endpoint which can emit events to subscribers.
Endpoint which can subscribe to events emitted by CPassiveMutator.
Interface that provides a transport mechanism for sharing state.
virtual void subscribe(const CPassiveObserver *observer)=0
Register an observer with this transport mechanism.
virtual void publish(const CActiveMutator *mutator)=0
Register a mutator with this transport mechanism.
virtual void publish(const CPassiveMutator *mutator)=0
Register a mutator with this transport mechanism.
virtual void subscribe(const CActiveObserver *observer)=0
Register an observer with this transport mechanism.
void setConnectionStatus(bool connected)
Set the connection status visible through the watcher.
virtual ~IDataLink()=0
Destructor.
CDataLinkConnectionWatcher * watcher()
Get a connection status watcher.
Utilities for sharing state between multiple objects.
#define SWIFT_MISC_EXPORT
Export a class or function from the library.