|
libdrmconf 0.13.3
A library to program DMR radios.
|
Implements a visitor to merge the visited config into a given config. More...
#include <configmergevisitor.hh>


Public Types | |
| enum class | ItemStrategy { Ignore , Override , Duplicate } |
| Possible strategies to merge atomic items. More... | |
| enum class | SetStrategy { Ignore , Override , Duplicate , Merge } |
| Possible strategies to merge sets of references. More... | |
Public Member Functions | |
| ConfigMergeVisitor (Config *destination, QHash< ConfigObject *, ConfigObject * > &translation, ItemStrategy itemStrategy=ItemStrategy::Ignore, SetStrategy setStrategy=SetStrategy::Ignore) | |
| Constructor of the merge visitor. | |
| bool | processItem (ConfigItem *item, const ErrorStack &err=ErrorStack()) |
| Traverses the specified config item. | |
| Public Member Functions inherited from Visitor | |
| virtual | ~Visitor () |
| Destructor. | |
| virtual bool | process (Config *config, const ErrorStack &err=ErrorStack()) |
| Traverses the properties of the configuration recursively. | |
| virtual bool | processProperty (ConfigItem *item, const QMetaProperty &prop, const ErrorStack &err=ErrorStack()) |
| Processes the specified property of the item. | |
| virtual bool | processEnum (ConfigItem *item, const QMetaProperty &prop, const ErrorStack &err=ErrorStack()) |
| Handles an enum typed property. | |
| virtual bool | processBool (ConfigItem *item, const QMetaProperty &prop, const ErrorStack &err=ErrorStack()) |
| Handles a boolean typed property. | |
| virtual bool | processInt (ConfigItem *item, const QMetaProperty &prop, const ErrorStack &err=ErrorStack()) |
| Handles an integer typed property. | |
| virtual bool | processUInt (ConfigItem *item, const QMetaProperty &prop, const ErrorStack &err=ErrorStack()) |
| Handles an unsigned integer typed property. | |
| virtual bool | processDouble (ConfigItem *item, const QMetaProperty &prop, const ErrorStack &err=ErrorStack()) |
| Handles a double precision float typed property. | |
| virtual bool | processString (ConfigItem *item, const QMetaProperty &prop, const ErrorStack &err=ErrorStack()) |
| Handles a string typed property. | |
| virtual bool | processFrequency (ConfigItem *item, const QMetaProperty &prop, const ErrorStack &err=ErrorStack()) |
Handles a Frequency typed property. | |
| virtual bool | processInterval (ConfigItem *item, const QMetaProperty &prop, const ErrorStack &err=ErrorStack()) |
Handles a Interval typed property. | |
| virtual bool | processSelectiveCall (ConfigItem *item, const QMetaProperty &prop, const ErrorStack &err=ErrorStack()) |
Handles a SelectiveCall typed property. | |
| virtual bool | processUnknownType (ConfigItem *item, const QMetaProperty &prop, const ErrorStack &err=ErrorStack()) |
| Handles a property of unknown type. | |
| virtual bool | processList (AbstractConfigObjectList *list, const ErrorStack &err=ErrorStack()) |
| Traverses the list of objects or references. | |
| virtual bool | processReference (ConfigObjectReference *, const ErrorStack &err=ErrorStack()) |
| Handles references to config objects. | |
Protected Member Functions | |
| bool | processRadioID (RadioID *item, const ErrorStack &err=ErrorStack()) |
| Handles a RadioID object of the source configuration. | |
| bool | processChannel (Channel *item, const ErrorStack &err=ErrorStack()) |
| Handles a Channel object of the source configuration. | |
| bool | processContact (Contact *item, const ErrorStack &err=ErrorStack()) |
| Handles a Contact object of the source configuration. | |
| bool | processPositioningSystem (PositioningSystem *item, const ErrorStack &err=ErrorStack()) |
| Handles a PositioningSystem object of the source configuration. | |
| bool | processRoamingChannel (RoamingChannel *item, const ErrorStack &err=ErrorStack()) |
| Handles a RoamingChannel object of the source configuration. | |
| bool | processGroupList (RXGroupList *item, const ErrorStack &err=ErrorStack()) |
| Handles a RXGroupList object of the source configuration. | |
| bool | processZone (Zone *item, const ErrorStack &err=ErrorStack()) |
| Handles a Zone object of the source configuration. | |
| bool | processScanList (ScanList *item, const ErrorStack &err=ErrorStack()) |
| Handles a ScanList object of the source configuration. | |
| bool | processRoamingZone (RoamingZone *item, const ErrorStack &err=ErrorStack()) |
| Handles a RoamingZone object of the source configuration. | |
| bool | addObject (AbstractConfigObjectList *list, ConfigObject *present, ConfigObject *merging, const ErrorStack &err=ErrorStack()) |
Adds a copy of the merging object to the given list, containing the colliding present object. | |
| bool | ignoreObject (AbstractConfigObjectList *list, ConfigObject *present, ConfigObject *merging, const ErrorStack &err=ErrorStack()) |
Does not add the merging object, but fixes the translation table to bend references to the merging object. | |
| bool | replaceObject (AbstractConfigObjectList *list, ConfigObject *present, ConfigObject *merging, const ErrorStack &err=ErrorStack()) |
Replaces the present object in the given list by a copy of merging object. | |
| bool | duplicateObject (AbstractConfigObjectList *list, ConfigObject *present, ConfigObject *merging, const ErrorStack &err=ErrorStack()) |
Adds a copy of the merging object to the given list. | |
| bool | mergeList (ConfigObjectRefList *present, ConfigObjectRefList *merging, const ErrorStack &err=ErrorStack()) |
| Merges two reference lists. | |
| Protected Member Functions inherited from Visitor | |
| Visitor () | |
| Hidden constructor. | |
Protected Attributes | |
| Config * | _destination |
| The destination configuration. | |
| QHash< ConfigObject *, ConfigObject * > & | _translation |
| Translation table for fixing references. | |
| ItemStrategy | _itemStrategy |
| The item merge strategy. | |
| SetStrategy | _setStrategy |
| The set merge strategy. | |
Implements a visitor to merge the visited config into a given config.
The destination configuration object is passed to the constructor. This allows to merge several configurations into one.
|
strong |
Possible strategies to merge atomic items.
That is, Channels, Contacts & PositioningSystems, if there are two items with the same name.
| Enumerator | |
|---|---|
| Ignore | Ignore the source item. |
| Override | Override the destination item. |
| Duplicate | Add a new item with a modified name. |
|
strong |
Possible strategies to merge sets of references.
That is, GroupLists, Zones & ScanLists, if there are two sets with the same name.
| Enumerator | |
|---|---|
| Ignore | Ignore the source set. |
| Override | Override the destination item. |
| Duplicate | Add a new set with a modified name. |
| Merge | Merge sets. |
| ConfigMergeVisitor::ConfigMergeVisitor | ( | Config * | destination, |
| QHash< ConfigObject *, ConfigObject * > & | translation, | ||
| ItemStrategy | itemStrategy = ItemStrategy::Ignore, | ||
| SetStrategy | setStrategy = SetStrategy::Ignore ) |
Constructor of the merge visitor.
| destination | Specifies the destination configuration, the additional configurations are merged into. |
| translation | Specifies the translation table to fill of objects being replaced. |
| itemStrategy | Specifies the item merge strategy. |
| setStrategy | Specifies the set merge strategy. |
|
protected |
Adds a copy of the merging object to the given list, containing the colliding present object.
Also updates the translation table to bend references to the merging object to that copy.
|
protected |
Merges two reference lists.
That is, merging gets merged into the present list.
|
virtual |
Traverses the specified config item.
This method calls processProperty on all properties of the item.
Reimplemented from Visitor.
|
protected |
Replaces the present object in the given list by a copy of merging object.
Also fixes the translation table to bend references to both the removed present object as well as the merging object.