swift
Loading...
Searching...
No Matches
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
13namespace swift::misc
14{
16
17 namespace shared_state::dbus
18 {
22 class SWIFT_MISC_EXPORT CHubProxy final : public IHub
23 {
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 ~CHubProxy() override;
33
36 bool isConnected() const override;
37 std::pair<QSharedPointer<IDuplex>, QFuture<bool>> getDuplex(const CIdentifier &) override;
39
40 public slots:
43
45 bool openDuplex(const swift::misc::CIdentifier &client) override;
46
48 void closeDuplex(const swift::misc::CIdentifier &client) override;
50
51 protected:
54 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
QFuture< bool > openDuplexAsync(const CIdentifier &client)
Create a duplex object for the identified process.
Definition hubproxy.cpp:42
CHubProxy(const QDBusConnection &connection, const QString &service, QObject *parent=nullptr)
Constructor.
Definition hubproxy.cpp:15
void closeDuplex(const swift::misc::CIdentifier &client)
Destroy the duplex object for the identified process.
Definition hubproxy.cpp:37
bool isConnected() const
Create a duplex object for the identified process.
Definition hubproxy.cpp:23
std::pair< QSharedPointer< IDuplex >, QFuture< bool > > getDuplex(const CIdentifier &)
Create a duplex object for the identified process.
Definition hubproxy.cpp:25
bool openDuplex(const swift::misc::CIdentifier &client)
Create a duplex object for the identified process.
Definition hubproxy.cpp:32
IHub(QObject *parent=nullptr)
Constructor.
Definition hub.cpp:15
#define SWIFT_MISC_HUB_INTERFACE
DBus interface for sharedstate hub.
Definition hub.h:17
Free functions in swift::misc.
QObject(QObject *parent)
Q_CLASSINFO(Name, Value)
Q_OBJECTQ_OBJECT
QObject * parent() const const
#define SWIFT_MISC_EXPORT
Export a class or function from the library.