libdrmconf  0.12.0
A library to program DMR radios.
intermediaterepresentation.hh
1 
7 #ifndef INTERMEDIATEREPRESENTATION_HH
8 #define INTERMEDIATEREPRESENTATION_HH
9 
10 #include "visitor.hh"
11 #include <QList>
12 
13 class Zone;
14 
15 
21 {
22 public:
24  explicit ZoneSplitVisitor();
25 
26  bool processItem(ConfigItem *item, const ErrorStack &err);
27 };
28 
34 {
35 public:
37  explicit ZoneMergeVisitor();
38 
39  bool processList(AbstractConfigObjectList *list, const ErrorStack &err);
40  bool processItem(ConfigItem *item, const ErrorStack &err);
41 
42 protected:
46  QList<Zone *> _mergedZones;
47 };
48 
49 
54 {
55 public:
57  explicit ObjectFilterVisitor(const std::initializer_list<QMetaObject> &types);
58 
59  bool processProperty(ConfigItem *item, const QMetaProperty &prop, const ErrorStack &err);
60  bool processList(AbstractConfigObjectList *list, const ErrorStack &err);
61 
62 protected:
64  QList<QMetaObject> _filter;
65 };
66 
67 
68 #endif // INTERMEDIATEREPRESENTATION_HH
Generic list class for config objects.
Definition: configobject.hh:258
Base class for all configuration objects (channels, zones, contacts, etc).
Definition: configobject.hh:40
Implements a stack of error messages to provide a pretty formatted error traceback.
Definition: errorstack.hh:41
Fitlers instance by meta object.
Definition: intermediaterepresentation.hh:54
QList< QMetaObject > _filter
The list of filtered types.
Definition: intermediaterepresentation.hh:64
bool processList(AbstractConfigObjectList *list, const ErrorStack &err)
Traverses the list of objects or references.
Definition: intermediaterepresentation.cc:143
ObjectFilterVisitor(const std::initializer_list< QMetaObject > &types)
Constructor from initializer list of Qt meta objects.
Definition: intermediaterepresentation.cc:112
bool processProperty(ConfigItem *item, const QMetaProperty &prop, const ErrorStack &err)
Processes the specified property of the item.
Definition: intermediaterepresentation.cc:119
Base visitor class for the config tree.
Definition: visitor.hh:20
Simple visitor that merges zones.
Definition: intermediaterepresentation.hh:34
bool processList(AbstractConfigObjectList *list, const ErrorStack &err)
Traverses the list of objects or references.
Definition: intermediaterepresentation.cc:56
ZoneMergeVisitor()
Constructor.
Definition: intermediaterepresentation.cc:49
Zone * _lastZone
The last zone visited, nullptr if the first zone is processed.
Definition: intermediaterepresentation.hh:44
QList< Zone * > _mergedZones
Zones to be removed.
Definition: intermediaterepresentation.hh:46
bool processItem(ConfigItem *item, const ErrorStack &err)
Traverses the specified config item.
Definition: intermediaterepresentation.cc:85
Simple visitor that splits Zones having A and B channels into two zones with A-lists only.
Definition: intermediaterepresentation.hh:21
ZoneSplitVisitor()
Constructor.
Definition: intermediaterepresentation.cc:9
bool processItem(ConfigItem *item, const ErrorStack &err)
Traverses the specified config item.
Definition: intermediaterepresentation.cc:16
Represents a zone within the generic configuration.
Definition: zone.hh:15