1// Copyright (C) 2017 Andre Hartmann <aha_1980@gmx.de>
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QCANBUSDEVICEINFO_H
5#define QCANBUSDEVICEINFO_H
6
7#include <QtCore/qshareddata.h>
8#include <QtCore/qstring.h>
9#include <QtSerialBus/qtserialbusglobal.h>
10
11QT_BEGIN_NAMESPACE
12
13class QCanBusDeviceInfoPrivate;
14
15QT_DECLARE_QSDP_SPECIALIZATION_DTOR(QCanBusDeviceInfoPrivate)
16
17class Q_SERIALBUS_EXPORT QCanBusDeviceInfo
18{
19public:
20 QCanBusDeviceInfo() = delete;
21 QCanBusDeviceInfo(const QCanBusDeviceInfo &other);
22 QCanBusDeviceInfo(QCanBusDeviceInfo &&other) noexcept = default;
23 ~QCanBusDeviceInfo();
24
25 void swap(QCanBusDeviceInfo &other) noexcept
26 {
27 d_ptr.swap(other&: other.d_ptr);
28 }
29
30 QCanBusDeviceInfo &operator=(const QCanBusDeviceInfo &other);
31 QCanBusDeviceInfo &operator=(QCanBusDeviceInfo &&other) noexcept
32 {
33 swap(other);
34 return *this;
35 }
36
37 QString plugin() const;
38 QString name() const;
39 QString description() const;
40 QString serialNumber() const;
41 QString alias() const;
42 int channel() const;
43
44 bool hasFlexibleDataRate() const;
45 bool isVirtual() const;
46
47private:
48 friend class QCanBusDevice;
49
50 explicit QCanBusDeviceInfo(QCanBusDeviceInfoPrivate &dd);
51
52 QSharedDataPointer<QCanBusDeviceInfoPrivate> d_ptr;
53};
54
55Q_DECLARE_SHARED(QCanBusDeviceInfo)
56
57QT_END_NAMESPACE
58
59#endif // QCANBUSDEVICEINFO_H
60

source code of qtserialbus/src/serialbus/qcanbusdeviceinfo.h