#ifndef IOCONNECTION_H #define IOCONNECTION_H #include #include #include #include "typeutils.h" #include "thing.h" struct IOConnectionResult { Thing::ThingError error = Thing::ThingErrorNoError; IOConnectionId ioConnectionId; }; class IOConnection { Q_GADGET Q_PROPERTY(QUuid id READ id) Q_PROPERTY(QUuid inputThingId READ inputThingId) Q_PROPERTY(QUuid inputStateTypeId READ inputStateTypeId) Q_PROPERTY(QUuid outputThingId READ outputThingId) Q_PROPERTY(QUuid outputStateTypeId READ outputStateTypeId) public: IOConnection(); IOConnection(const IOConnectionId &id, const ThingId &inputThingId, const StateTypeId &inputStateTypeId, const ThingId &outputThingId, const StateTypeId &outputStateTypeId); IOConnectionId id() const; ThingId inputThingId() const; StateTypeId inputStateTypeId() const; ThingId outputThingId() const; StateTypeId outputStateTypeId() const; private: IOConnectionId m_id; ThingId m_inputThingId; StateTypeId m_inputStateTypeId; ThingId m_outputThingId; StateTypeId m_outputStateTypeId; }; class IOConnections: public QList { Q_GADGET Q_PROPERTY(int count READ count) public: IOConnections() {} inline IOConnections(std::initializer_list args): QList(args) {} IOConnections(const QList &other): QList(other) {} Q_INVOKABLE QVariant get(int index) const; Q_INVOKABLE void put(const QVariant &variant); }; Q_DECLARE_METATYPE(IOConnection) Q_DECLARE_METATYPE(IOConnections) #endif // IOCONNECTION_H