dbus-cxx
qtthreaddispatcher.h
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-3.0-or-later OR BSD-3-Clause
2// SPDX-License-Identifier: LGPL-3.0-or-later OR BSD-3-Clause
3/***************************************************************************
4 * Copyright (C) 2020 by Robert Middleton *
5 * robert.middleton@rm5248.com *
6 * *
7 * This file is part of the dbus-cxx library. *
8 * *
9 * The dbus-cxx library is free software; you can redistribute it and/or *
10 * modify it under the terms of the GNU General Public License *
11 * version 3 as published by the Free Software Foundation. *
12 * *
13 * The dbus-cxx library is distributed in the hope that it will be *
14 * useful, but WITHOUT ANY WARRANTY; without even the implied warranty *
15 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
16 * General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU General Public License *
19 * along with this software. If not see <http://www.gnu.org/licenses/>. *
20 ***************************************************************************/
21#ifndef DBUS_CXX_QT_THREAD_DISPATCHER
22#define DBUS_CXX_QT_THREAD_DISPATCHER
23
25#include <dbus-cxx/connection.h>
26#include <dbus-cxx/dbus-cxx-config.h>
27#include <memory>
28#include <QObject>
29
30namespace DBus {
31namespace Qt {
32
33class QtThreadDispatcher : public QObject,
35 Q_OBJECT
36
37private:
39
40public:
42
43 void add_message( std::shared_ptr<Object> object, std::shared_ptr<const CallMessage> message );
44 void add_signal_proxy( std::shared_ptr<SignalProxyBase> handler );
45 bool remove_signal_proxy( std::shared_ptr<SignalProxyBase> handler );
46 void add_signal( std::shared_ptr<const SignalMessage> message );
47
48 static std::shared_ptr<QtThreadDispatcher> create();
49
50Q_SIGNALS:
52
53private Q_SLOTS:
54 void sendMessages();
55
56private:
57 class priv_data;
58
59 DBUS_CXX_PROPAGATE_CONST(std::unique_ptr<priv_data>) m_priv;
60};
61
62} /* namespace Qt */
63} /* namespace DBus */
64
65#endif /* DBUX_CXX_QT_THREAD_DISPATCHER */
Definition: qtthreaddispatcher.h:34
bool remove_signal_proxy(std::shared_ptr< SignalProxyBase > handler)
Definition: qtthreaddispatcher.cpp:80
DBUS_CXX_PROPAGATE_CONST(std::unique_ptr< priv_data >) m_priv
~QtThreadDispatcher()
Definition: qtthreaddispatcher.cpp:55
static std::shared_ptr< QtThreadDispatcher > create()
Definition: qtthreaddispatcher.cpp:59
void add_message(std::shared_ptr< Object > object, std::shared_ptr< const CallMessage > message)
Definition: qtthreaddispatcher.cpp:63
QtThreadDispatcher()
Definition: qtthreaddispatcher.cpp:47
void add_signal_proxy(std::shared_ptr< SignalProxyBase > handler)
Definition: qtthreaddispatcher.cpp:75
void add_signal(std::shared_ptr< const SignalMessage > message)
Definition: qtthreaddispatcher.cpp:93
void sendMessages()
Definition: qtthreaddispatcher.cpp:101
A ThreadDispatcher is responsible for executing method calls and signals on objects in the given thre...
Definition: threaddispatcher.h:36
Global DBus namespace, where everything happens.
Definition: callmessage.cpp:18