libdrmconf
0.11.3
A library to program DMR radios.
|
Represents the list of configured DMR IDs (radio IDs) within the abstract config. More...
#include <radioid.hh>
Public Member Functions | |
RadioIDList (QObject *parent=nullptr) | |
Constructor. | |
void | clear () |
Clears the list. | |
DMRRadioID * | getId (int idx) const |
Returns the radio ID at the given index. | |
DMRRadioID * | defaultId () const |
Returns the current default ID for the radio. | |
bool | setDefaultId (int idx) |
Sets the default DMR ID. More... | |
DMRRadioID * | find (uint32_t id) const |
Searches the DMR ID object associated with the given DMR ID. | |
int | add (ConfigObject *obj, int row=-1) |
Adds an element to the list. | |
virtual int | addId (const QString &name, uint32_t id) |
Adds the given DMR ID. | |
virtual bool | delId (uint32_t id) |
Deletes and removes the given DMR ID. | |
ConfigItem * | allocateChild (const YAML::Node &node, ConfigItem::Context &ctx, const ErrorStack &err=ErrorStack()) |
Allocates a member objects for the given YAML node. | |
Public Member Functions inherited from ConfigObjectList | |
bool | take (ConfigObject *obj) |
Removes an element from the list. | |
bool | del (ConfigObject *obj) |
Removes an element from the list (and deletes it if owned). | |
bool | copy (const AbstractConfigObjectList &other) |
Copies all elements from other to this list. | |
virtual int | compare (const ConfigObjectList &other) const |
Compares the object lists. More... | |
virtual bool | parse (const YAML::Node &node, ConfigItem::Context &ctx, const ErrorStack &err=ErrorStack()) |
Parses the list from the YAML node. | |
virtual bool | link (const YAML::Node &node, const ConfigItem::Context &ctx, const ErrorStack &err=ErrorStack()) |
Links the list from the given YAML node. | |
bool | label (ConfigItem::Context &context, const ErrorStack &err=ErrorStack()) |
Recursively labels the config object. | |
YAML::Node | serialize (const ConfigItem::Context &context, const ErrorStack &err=ErrorStack()) |
Recursively serializes the configuration to YAML nodes. More... | |
Public Member Functions inherited from AbstractConfigObjectList | |
virtual int | count () const |
Returns the number of elements in the list. | |
virtual int | indexOf (ConfigObject *obj) const |
Returns the index of the given object within the list. | |
virtual const Config * | config () const |
Returns the config object, this list belongs to. | |
virtual void | findItemsOfTypes (const QStringList &typeNames, QSet< ConfigItem * > &items) const |
Searches the config tree to find all instances of the given type names. | |
virtual bool | has (ConfigObject *obj) const |
Returns true , if the list contains the given object. | |
virtual ConfigObject * | get (int idx) const |
Returns the list element at the given index or nullptr if out of bounds. | |
virtual bool | moveUp (int idx) |
Moves the channel at index idx one step up. | |
virtual bool | moveUp (int first, int last) |
Moves the channels at one step up. | |
virtual bool | moveDown (int idx) |
Moves the channel at index idx one step down. | |
virtual bool | moveDown (int first, int last) |
Moves the channels one step down. | |
const QList< QMetaObject > & | elementTypes () const |
Returns the element type for this list. | |
QStringList | classNames () const |
Returns a list of all class names. | |
Protected Slots | |
void | onDefaultIdDeleted () |
Gets call whenever the default DMR ID gets deleted. | |
Protected Attributes | |
DMRRadioID * | _default |
Holds a weak reference to the default DMR radio ID. | |
Protected Attributes inherited from AbstractConfigObjectList | |
QList< QMetaObject > | _elementTypes |
Holds the static QMetaObject of the element type. | |
QVector< ConfigObject * > | _items |
Holds the list items. | |
Additional Inherited Members | |
Signals inherited from AbstractConfigObjectList | |
void | elementAdded (int idx) |
Gets emitted if an element was added to the list. | |
void | elementModified (int idx) |
Gets emitted if one of the lists elements gets modified. | |
void | elementRemoved (int idx) |
Gets emitted if one of the lists elements gets deleted. | |
Protected Member Functions inherited from ConfigObjectList | |
ConfigObjectList (const QMetaObject &elementTypes=ConfigItem::staticMetaObject, QObject *parent=nullptr) | |
Hidden constructor. | |
ConfigObjectList (const std::initializer_list< QMetaObject > &elementTypes, QObject *parent=nullptr) | |
Hidden constructor from initializer list. | |
Protected Member Functions inherited from AbstractConfigObjectList | |
AbstractConfigObjectList (const QMetaObject &elementTypes=ConfigObject::staticMetaObject, QObject *parent=nullptr) | |
Hidden constructor. | |
AbstractConfigObjectList (const std::initializer_list< QMetaObject > &elementTypes, QObject *parent=nullptr) | |
Hidden constructor from initializer list. | |
Represents the list of configured DMR IDs (radio IDs) within the abstract config.
There must always be at least one valid DMR ID. The first (index 0) ID is always the default DMR ID of the radio.
bool RadioIDList::setDefaultId | ( | int | idx | ) |
Sets the default DMR ID.
Pass idx=-1 to clear default ID.