swift
hubproxy.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_HUBPROXY_H
7 #define SWIFT_MISC_SHAREDSTATE_DBUS_HUBPROXY_H
8 
9 #include <QDBusConnection>
10 
12 
13 namespace swift::misc
14 {
15  class CGenericDBusInterface;
16 
17  namespace shared_state::dbus
18  {
22  class SWIFT_MISC_EXPORT CHubProxy final : public IHub
23  {
24  Q_OBJECT
25  Q_CLASSINFO("D-Bus Interface", SWIFT_MISC_HUB_INTERFACE)
26 
27  public:
29  CHubProxy(const QDBusConnection &connection, const QString &service, QObject *parent = nullptr);
30 
32  virtual ~CHubProxy() override;
33 
36  virtual bool isConnected() const override;
37  virtual std::pair<QSharedPointer<IDuplex>, QFuture<bool>> getDuplex(const CIdentifier &) override;
39 
40  public slots:
43 
45  virtual bool openDuplex(const swift::misc::CIdentifier &client) override;
46 
48  virtual void closeDuplex(const swift::misc::CIdentifier &client) override;
50 
51  protected:
54  virtual QFuture<bool> openDuplexAsync(const CIdentifier &client) override;
56 
57  private:
58  CGenericDBusInterface *m_interface = nullptr;
59  QString m_service;
60  };
61  } // namespace shared_state::dbus
62 } // namespace swift::misc
63 
64 #endif // SWIFT_MISC_SHAREDSTATE_DBUS_HUBPROXY_H
Used for hand written interface based on virtual methods.
Value object encapsulating information identifying a component of a modular distributed swift process...
Definition: identifier.h:29
Client side implementation of IHub.
Definition: hubproxy.h:23
Abstract interface for the hub in a star topology.
Definition: hub.h:37
#define SWIFT_MISC_HUB_INTERFACE
DBus interface for sharedstate hub.
Definition: hub.h:17
Free functions in swift::misc.
#define SWIFT_MISC_EXPORT
Export a class or function from the library.