dbus-cxx
qtdispatcher.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_DISPATCHER_H
22#define DBUS_CXX_QT_DISPATCHER_H
23
24#include <dbus-cxx/dispatcher.h>
25
26#include <QObject>
27
28namespace DBus {
29namespace Qt {
30
31class QtDispatcher : public QObject,
32 public Dispatcher {
33 Q_OBJECT
34private:
36
37public:
39
40 static std::shared_ptr<QtDispatcher> create();
41
42 std::shared_ptr<Connection> create_connection( BusType type );
43
44 std::shared_ptr<Connection> create_connection( std::string address );
45
46 bool add_connection( std::shared_ptr<Connection> connection );
47
48private Q_SLOTS:
49 void activated( int socket );
50
51private:
52 class priv_data;
53
54 DBUS_CXX_PROPAGATE_CONST(std::unique_ptr<priv_data>) m_priv;
55};
56
57} /* namespace Qt */
58} /* namespace DBus */
59
60#endif /* DBUS_CXX_QT_DISPATCHER_H */
A Dispatcher handles all of the reading/writing that a Connection needs in order to work correctly.
Definition: dispatcher.h:24
Definition: qtdispatcher.h:32
bool add_connection(std::shared_ptr< Connection > connection)
Definition: qtdispatcher.cpp:67
~QtDispatcher()
Definition: qtdispatcher.cpp:43
void activated(int socket)
Definition: qtdispatcher.cpp:85
DBUS_CXX_PROPAGATE_CONST(std::unique_ptr< priv_data >) m_priv
static std::shared_ptr< QtDispatcher > create()
Definition: qtdispatcher.cpp:47
QtDispatcher()
Definition: qtdispatcher.cpp:36
std::shared_ptr< Connection > create_connection(BusType type)
Definition: qtdispatcher.cpp:51
Global DBus namespace, where everything happens.
Definition: callmessage.cpp:18
BusType
Definition: enums.h:16
DataType type(const uint8_t &)
Definition: types.h:139