libdrmconf 0.12.1
A library to program DMR radios.
Loading...
Searching...
No Matches
RadioLimitObjects Class Reference

Dispatch by class. More...

#include <radiolimits.hh>

Inheritance diagram for RadioLimitObjects:
Collaboration diagram for RadioLimitObjects:

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.
 
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.
 
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.
 
bool add (const QString &prop, RadioLimitElement *structure)
 Adds a property declaration.
 
virtual bool verify (const ConfigItem *item, const QMetaProperty &prop, RadioLimitContext &context) const
 Verifies the given property of the specified item.
 
- 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:426
Dispatch by class.
Definition radiolimits.hh:472

Member Function Documentation

◆ verifyItem()

bool RadioLimitObjects::verifyItem ( const ConfigItem * item,
RadioLimitContext & context ) const
virtual

Verifies the properties of the given item.

Reimplemented from RadioLimitItem.


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