| 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 | |
| 11 | QT_BEGIN_NAMESPACE |
| 12 | |
| 13 | class QCanBusDeviceInfoPrivate; |
| 14 | |
| 15 | QT_DECLARE_QSDP_SPECIALIZATION_DTOR(QCanBusDeviceInfoPrivate) |
| 16 | |
| 17 | class Q_SERIALBUS_EXPORT QCanBusDeviceInfo |
| 18 | { |
| 19 | public: |
| 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 | |
| 47 | private: |
| 48 | friend class QCanBusDevice; |
| 49 | |
| 50 | explicit QCanBusDeviceInfo(QCanBusDeviceInfoPrivate &dd); |
| 51 | |
| 52 | QSharedDataPointer<QCanBusDeviceInfoPrivate> d_ptr; |
| 53 | }; |
| 54 | |
| 55 | Q_DECLARE_SHARED(QCanBusDeviceInfo) |
| 56 | |
| 57 | QT_END_NAMESPACE |
| 58 | |
| 59 | #endif // QCANBUSDEVICEINFO_H |
| 60 |
