libdrmconf  0.10.4
A library to program DMR radios.
Public Types | Public Member Functions | Protected Attributes | List of all members
RadioLimitObjects Class Reference

Dispatch by class. More...

#include <radiolimits.hh>

Inheritance diagram for RadioLimitObjects:
Inheritance graph
[legend]
Collaboration diagram for RadioLimitObjects:
Collaboration graph
[legend]

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.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ RadioLimitObjects()

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

{ AnalogChannel::staticMetaObject, new RadioLimitObject{
// Limits for analog channel objects
} },
{DigialChannel::staticMetaObject, new RadioLimitObject{
// Limits for digital channel objects
} }
};
Represents the limits for all properties of a ConfigObject instance.
Definition: radiolimits.hh:420
Dispatch by class.
Definition: radiolimits.hh:466

The documentation for this class was generated from the following files: