File indexing completed on 2024-04-14 14:30:37

0001 /*
0002     SPDX-FileCopyrightText: 2013 Jan Grulich <jgrulich@redhat.com>
0003 
0004     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0005 */
0006 
0007 #ifndef NETWORKMANAGERQT_INFINIBAND_DEVICE_H
0008 #define NETWORKMANAGERQT_INFINIBAND_DEVICE_H
0009 
0010 #include "device.h"
0011 #include <networkmanagerqt/networkmanagerqt_export.h>
0012 
0013 namespace NetworkManager
0014 {
0015 class InfinibandDevicePrivate;
0016 
0017 /**
0018  * An infiniband device interface
0019  */
0020 class NETWORKMANAGERQT_EXPORT InfinibandDevice : public Device
0021 {
0022     Q_OBJECT
0023     Q_PROPERTY(bool carrier READ carrier NOTIFY carrierChanged)
0024     Q_PROPERTY(QString hwAddress READ hwAddress NOTIFY hwAddressChanged)
0025 
0026 public:
0027     typedef QSharedPointer<InfinibandDevice> Ptr;
0028     typedef QList<Ptr> List;
0029     explicit InfinibandDevice(const QString &path, QObject *parent = nullptr);
0030     ~InfinibandDevice() override;
0031 
0032     Type type() const override;
0033 
0034     /**
0035      * Indicates whether the physical carrier is found
0036      */
0037     bool carrier() const;
0038     /**
0039      * Hardware address of the device
0040      */
0041     QString hwAddress() const;
0042 
0043 Q_SIGNALS:
0044     /**
0045      * Emitted when the carrier of this device has changed
0046      */
0047     void carrierChanged(bool plugged);
0048     /**
0049      * Emitted when the hardware address of this device has changed
0050      */
0051     void hwAddressChanged(const QString &address);
0052 
0053 private:
0054     Q_DECLARE_PRIVATE(InfinibandDevice)
0055 };
0056 
0057 }
0058 
0059 #endif