swift
dupleximpl.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (C) 2020 swift Project Community / Contributors
2 // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
3 
5 
6 #ifndef SWIFT_MISC_SHAREDSTATE_DBUS_DUPLEXIMPL_H
7 #define SWIFT_MISC_SHAREDSTATE_DBUS_DUPLEXIMPL_H
8 
9 #include <functional>
10 
12 
13 namespace swift::misc
14 {
15  class CIdentifier;
16  class CDBusServer;
17 
18  namespace shared_state::dbus
19  {
20  class CHub;
21 
26  class SWIFT_MISC_EXPORT CDuplex final : public IDuplex
27  {
28  Q_OBJECT
29  Q_CLASSINFO("D-Bus Interface", SWIFT_MISC_DUPLEX_INTERFACE)
30 
31  public:
33  CDuplex(CHub *hub, const CIdentifier &client, CDBusServer *server, QObject *parent = nullptr);
34 
36  ~CDuplex() override;
37 
38  public slots:
41 
43  void postEvent(const QString &channel, const swift::misc::CVariant &param) override;
44 
46  void setSubscription(const QString &channel, const swift::misc::CVariantList &filters) override;
47 
49  void requestPeerSubscriptions() override;
50 
52  void submitRequest(const QString &channel, const swift::misc::CVariant &param, quint32 token) override;
53 
55  void advertise(const QString &channel) override;
56 
58  void withdraw(const QString &channel) override;
60 
61  private:
62  void requestPeerSubscriptions(const QString &channel);
63 
64  CHub *m_hub = nullptr;
65  QMap<QString, CVariantList> m_subscriptions;
66  QSet<QString> m_handlingChannels;
67  };
68  } // namespace shared_state::dbus
69 } // namespace swift::misc
70 
71 #endif // SWIFT_MISC_SHAREDSTATE_DBUS_DUPLEXIMPL_H
Custom DBusServer.
Definition: dbusserver.h:34
Value object encapsulating information identifying a component of a modular distributed swift process...
Definition: identifier.h:29
Wrapper around QVariant which provides transparent access to CValueObject methods of the contained ob...
Definition: variant.h:66
Value object encapsulating a list of variants.
Definition: variantlist.h:29
Server side implementation of IDuplex.
Definition: dupleximpl.h:27
Server side implementation of IHub.
Definition: hubimpl.h:27
Abstract interface for the spoke in a star topology.
Definition: duplex.h:36
#define SWIFT_MISC_DUPLEX_INTERFACE
DBus interface for sharedstate hub.
Definition: duplex.h:19
Free functions in swift::misc.
#define SWIFT_MISC_EXPORT
Export a class or function from the library.