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

Specifies the limits for a list of ConfigObject instances. More...

#include <radiolimits.hh>

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

Classes

struct  ElementLimits
 Helper struct to pass list entry definitions. More...
 

Public Member Functions

 RadioLimitList (const QMetaObject &type, int minSize, int maxSize, RadioLimitObject *element, QObject *parent=nullptr)
 Constructor. More...
 
 RadioLimitList (const std::initializer_list< ElementLimits > &elements, QObject *parent=nullptr)
 Constructor from initializer list.
 
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 Member Functions

QString findClassName (const QMetaObject &type) const
 Searches for the specified type or one of its super-clsases in the set of allowed types.
 
- Protected Member Functions inherited from RadioLimitElement
 RadioLimitElement (QObject *parent=nullptr)
 Hidden constructor.
 

Protected Attributes

QHash< QString, RadioLimitObject * > _elements
 Maps typename to element definition.
 
QHash< QString, qint64 > _minCount
 Maps typename to minimum count.
 
QHash< QString, qint64 > _maxCount
 Maps typename to maximum count.
 

Additional Inherited Members

- Public Types inherited from RadioLimitElement
typedef std::initializer_list< std::pair< QString, RadioLimitElement * > > PropList
 Initializer lists of ConfigItem properties.
 

Detailed Description

Specifies the limits for a list of ConfigObject instances.

Constructor & Destructor Documentation

◆ RadioLimitList()

RadioLimitList::RadioLimitList ( const QMetaObject &  type,
int  minSize,
int  maxSize,
RadioLimitObject element,
QObject *  parent = nullptr 
)

Constructor.

Parameters
typeSpecifies the type of the elements.
minSizeSpecifies the minimum size of the list. If -1, no check is performed.
maxSizeSpecifies the maximum size of the list. If -1, no check is performed.
elementSpecifies the limits for all objects in the list. If the list contains instances of different ConfigObject types, use RadioLimitObjects dispatcher.
parentSpecifies the QObject parent.

Member Function Documentation

◆ verify()

bool RadioLimitList::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.


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