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
15class Q_SERIALBUS_EXPORT QCanBusDeviceInfo
16{
17public:
18 QCanBusDeviceInfo() = delete;
19 QCanBusDeviceInfo(const QCanBusDeviceInfo &other);
20 ~QCanBusDeviceInfo();
21
22 void swap(QCanBusDeviceInfo &other) noexcept
23 {
24 d_ptr.swap(other&: other.d_ptr);
25 }
26
27 QCanBusDeviceInfo &operator=(const QCanBusDeviceInfo &other);
28 QCanBusDeviceInfo &operator=(QCanBusDeviceInfo &&other) noexcept
29 {
30 swap(other);
31 return *this;
32 }
33
34 QString plugin() const;
35 QString name() const;
36 QString description() const;
37 QString serialNumber() const;
38 QString alias() const;
39 int channel() const;
40
41 bool hasFlexibleDataRate() const;
42 bool isVirtual() const;
43
44private:
45 friend class QCanBusDevice;
46
47 explicit QCanBusDeviceInfo(QCanBusDeviceInfoPrivate &dd);
48
49 QSharedDataPointer<QCanBusDeviceInfoPrivate> d_ptr;
50};
51
52Q_DECLARE_SHARED(QCanBusDeviceInfo)
53
54QT_END_NAMESPACE
55
56#endif // QCANBUSDEVICEINFO_H
57

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