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

Represents the limits for a ConfigItem instance. More...

#include <radiolimits.hh>

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

Public Member Functions

 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...
 
virtual bool verifyItem (const ConfigItem *item, RadioLimitContext &context) const
 Verifies the properties of the given item.
 
- Public Member Functions inherited from RadioLimitElement
virtual ~RadioLimitElement ()
 Destructor.
 

Protected Attributes

QHash< QString, RadioLimitElement * > _elements
 Holds the property <-> limits map.
 

Additional Inherited Members

- Public Types inherited from RadioLimitElement
typedef std::initializer_list< std::pair< QString, RadioLimitElement * > > PropList
 Initializer lists of ConfigItem properties.
 
- Protected Member Functions inherited from RadioLimitElement
 RadioLimitElement (QObject *parent=nullptr)
 Hidden constructor.
 

Detailed Description

Represents the limits for a ConfigItem instance.

That is, it holds the limits for every property of the ConfigItem instance. This class provides a initializer list constructor for easy programmatic construction of limits.

Constructor & Destructor Documentation

◆ RadioLimitItem()

RadioLimitItem::RadioLimitItem ( const PropList list,
QObject *  parent = nullptr 
)

Constructor from initializer list.

The ownership of all passed elements are taken.

Member Function Documentation

◆ add()

bool RadioLimitItem::add ( const QString &  prop,
RadioLimitElement structure 
)

Adds a property declaration.

The item takes the ownership of the structure declaration. If a property is already defined with the same name, false is returned.

Parameters
propSpecifies the name of the property.
structureSpecifies the structure declaration of the property value.
Returns
false If a property with the same name is already defined.

◆ verify()

bool RadioLimitItem::verify ( const ConfigItem item,
const QMetaProperty &  prop,
RadioLimitContext context 
) const
virtual

Verifies the given property of the specified item.

This method gets implemented by the specialized classes to implement the actual verification.

Implements RadioLimitElement.

Reimplemented in RadioLimitIgnored.


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