QKnxDatapointTypeFactory Class

The QKnxDatapointTypeFactory class is used to create QKnxDatapointTypes based on their main number and sub number. More...

Header: #include <QKnxDatapointTypeFactory>
qmake: QT += knx

Public Functions

~QKnxDatapointTypeFactory() = default
bool containsMainType(int mainType) const
bool containsSubType(int mainType, int subType) const
QKnxDatapointType *createType(int mainType, int subType) const
QKnxDatapointType *createType(QKnxDatapointType::Type type) const
QList<int> mainTypes() const
void registerType(int mainType, int subType, int size)
QList<int> subTypes(int mainType) const

Static Public Members

QKnxDatapointTypeFactory &instance()
int typeSize(int mainType)

Detailed Description

The QKnxDatapointTypeFactory class is used to create QKnxDatapointTypes based on their main number and sub number.

You can register one or more datapoints with this factory and query them based on mian number and sub number. This class follows the singleton design pattern. Only one instance of this class can be created and its reference can be fetched from the instance() method.

The KNX datapoint types are identified by a 16 bit main number and a 16-bit sub number.

Member Function Documentation

[default] QKnxDatapointTypeFactory::~QKnxDatapointTypeFactory()

Destroys the instance of QKnxDatapointTypeFactory.

bool QKnxDatapointTypeFactory::containsMainType(int mainType) const

Queries the factory for a the given mainType and if it is registered, returns true; false otherwise.

bool QKnxDatapointTypeFactory::containsSubType(int mainType, int subType) const

Queries the factory for a the given mainType and subType and if the type is registered, returns true; false otherwise.

QKnxDatapointType *QKnxDatapointTypeFactory::createType(int mainType, int subType) const

Returns a new instance of a QKnxDatapointType subclass. The instantiation of the subclass depends on the mainType and subType given as arguments to this function.

Note: Ownership of the created object remains with the programmer.

QKnxDatapointType *QKnxDatapointTypeFactory::createType(QKnxDatapointType::Type type) const

Returns a new instance of a QKnxDatapointType subclass. The instantiation of the subclass depends on the type given as argument to this function.

Note: Ownership of the created object remains with the programmer.

[static] QKnxDatapointTypeFactory &QKnxDatapointTypeFactory::instance()

QList<int> QKnxDatapointTypeFactory::mainTypes() const

Returns a list of registered main datapoint types.

void QKnxDatapointTypeFactory::registerType(int mainType, int subType, int size)

QList<int> QKnxDatapointTypeFactory::subTypes(int mainType) const

Returns a list of registered sub datapoint types for the given mainType.

[static] int QKnxDatapointTypeFactory::typeSize(int mainType)

Returns the size in bytes for the given mainType.

© 2017 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.