QKnxDatapointTypeFactory Class

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

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

Public Functions

~QKnxDatapointTypeFactory()
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 QKnxDatapointType objects based on their main number and sub number.

You can register one or more datapoints with this factory and query them based on the main 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.

See also Qt KNX Datapoint Type Classes.

Member Function Documentation

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: The 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 an argument to this function.

Note: The ownership of the created object remains with the programmer.

[static] QKnxDatapointTypeFactory &QKnxDatapointTypeFactory::instance()

Returns a reference to the datapoint type factory.

QList<int> QKnxDatapointTypeFactory::mainTypes() const

Returns a list of registered main datapoint types.

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

Registers a datapoint type with the main type mainType, sub type subType, and size 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.

© 2018 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.