QKnxDatapointTypeFactory Class

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

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

公共函数

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

静态公共成员

QKnxDatapointTypeFactory & instance ()
int typeSize (int mainType )

详细描述

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 () 方法。

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

另请参阅 Qt KNX Datapoint Type Classes .

成员函数文档编制

bool QKnxDatapointTypeFactory:: containsMainType ( int mainType ) const

Queries the factory for a the given mainType and if it is registered, returns true ; false 否则。

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 否则。

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.

注意: 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.

注意: The ownership of the created object remains with the programmer.

[static] QKnxDatapointTypeFactory &QKnxDatapointTypeFactory:: 实例 ()

Returns a reference to the datapoint type factory.

QList < int > QKnxDatapointTypeFactory:: mainTypes () const

Returns a list of registered main datapoint types.

template <typename Class> 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 .