libdrmconf
0.10.4
A library to program DMR radios.
|
Dispatch by class. More...
#include <radiolimits.hh>
Public Types | |
typedef std::initializer_list< std::pair< const QMetaObject &, RadioLimitObject * > > | TypeList |
Initializer lists of type properties. | |
Public Types inherited from RadioLimitElement | |
typedef std::initializer_list< std::pair< QString, RadioLimitElement * > > | PropList |
Initializer lists of ConfigItem properties. | |
Public Member Functions | |
RadioLimitObjects (const TypeList &list, QObject *parent=nullptr) | |
Constructor from initializer list. More... | |
bool | verifyItem (const ConfigItem *item, RadioLimitContext &context) const |
Verifies the properties of the given item. | |
Public Member Functions inherited from RadioLimitObject | |
RadioLimitObject (QObject *parent=nullptr) | |
Empty constructor. | |
RadioLimitObject (const PropList &list, QObject *parent=nullptr) | |
Constructor from initializer list. More... | |
virtual bool | verifyObject (const ConfigObject *item, RadioLimitContext &context) const |
Verifies the properties of the given object. | |
Public Member Functions inherited from RadioLimitItem | |
RadioLimitItem (QObject *parent=nullptr) | |
Empty constructor. | |
RadioLimitItem (const PropList &list, QObject *parent=nullptr) | |
Constructor from initializer list. More... | |
bool | add (const QString &prop, RadioLimitElement *structure) |
Adds a property declaration. More... | |
virtual bool | verify (const ConfigItem *item, const QMetaProperty &prop, RadioLimitContext &context) const |
Verifies the given property of the specified item. More... | |
Public Member Functions inherited from RadioLimitElement | |
virtual | ~RadioLimitElement () |
Destructor. | |
Protected Attributes | |
QHash< QString, RadioLimitObject * > | _types |
Maps class-names to object limits. | |
Protected Attributes inherited from RadioLimitItem | |
QHash< QString, RadioLimitElement * > | _elements |
Holds the property <-> limits map. | |
Additional Inherited Members | |
Protected Member Functions inherited from RadioLimitElement | |
RadioLimitElement (QObject *parent=nullptr) | |
Hidden constructor. | |
Dispatch by class.
Sometimes, a property may hold objects of different type. In these cases, a dispatcher is needed to specify which limits to apply based on the type of the object. This class implements this dispatcher.
RadioLimitObjects::RadioLimitObjects | ( | const TypeList & | list, |
QObject * | parent = nullptr |
||
) |
Constructor from initializer list.
A list of pairs of a QMetaObject
and a RadioLimitObject
must be given. The meta object specifies the type of the ConfigObject
and the associated RadioLimitObject
the limits for this type.
A dispatch for Analog and DigitalChannel may look like