libdrmconf  0.12.0
A library to program DMR radios.
visitor.hh
1 #ifndef VISITOR_HH
2 #define VISITOR_HH
3 
4 #include <QObject>
5 #include "errorstack.hh"
6 
7 // Forward declarations
8 class Config;
9 class ConfigItem;
12 
13 
19 class Visitor
20 {
21 protected:
23  Visitor();
24 
25 public:
27  virtual ~Visitor();
28 
31  virtual bool process(Config *config, const ErrorStack &err=ErrorStack());
32 
38  virtual bool processProperty(ConfigItem *item, const QMetaProperty &prop, const ErrorStack &err=ErrorStack());
39 
44  virtual bool processEnum(ConfigItem *item, const QMetaProperty &prop, const ErrorStack &err=ErrorStack());
49  virtual bool processBool(ConfigItem *item, const QMetaProperty &prop, const ErrorStack &err=ErrorStack());
54  virtual bool processInt(ConfigItem *item, const QMetaProperty &prop, const ErrorStack &err=ErrorStack());
59  virtual bool processUInt(ConfigItem *item, const QMetaProperty &prop, const ErrorStack &err=ErrorStack());
64  virtual bool processDouble(ConfigItem *item, const QMetaProperty &prop, const ErrorStack &err=ErrorStack());
69  virtual bool processString(ConfigItem *item, const QMetaProperty &prop, const ErrorStack &err=ErrorStack());
74  virtual bool processFrequency(ConfigItem *item, const QMetaProperty &prop, const ErrorStack &err=ErrorStack());
79  virtual bool processInterval(ConfigItem *item, const QMetaProperty &prop, const ErrorStack &err=ErrorStack());
85  virtual bool processUnknownType(ConfigItem *item, const QMetaProperty &prop, const ErrorStack &err=ErrorStack());
86 
89  virtual bool processItem(ConfigItem *item, const ErrorStack &err=ErrorStack());
90 
96  virtual bool processList(AbstractConfigObjectList *list, const ErrorStack &err=ErrorStack());
97 
100  virtual bool processReference(ConfigObjectReference*, const ErrorStack &err=ErrorStack());
101 };
102 
103 #endif // VISITOR_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 reference to a config object.
Definition: configreference.hh:17
The config class, representing the codeplug configuration.
Definition: config.hh:70
Implements a stack of error messages to provide a pretty formatted error traceback.
Definition: errorstack.hh:41
Base visitor class for the config tree.
Definition: visitor.hh:20
virtual bool processString(ConfigItem *item, const QMetaProperty &prop, const ErrorStack &err=ErrorStack())
Handles a string typed property.
Definition: visitor.cc:169
virtual bool processProperty(ConfigItem *item, const QMetaProperty &prop, const ErrorStack &err=ErrorStack())
Processes the specified property of the item.
Definition: visitor.cc:43
virtual bool processItem(ConfigItem *item, const ErrorStack &err=ErrorStack())
Traverses the specified config item.
Definition: visitor.cc:22
virtual ~Visitor()
Destructor.
Definition: visitor.cc:12
Visitor()
Hidden constructor.
Definition: visitor.cc:7
virtual bool processFrequency(ConfigItem *item, const QMetaProperty &prop, const ErrorStack &err=ErrorStack())
Handles a Frequency typed property.
Definition: visitor.cc:176
virtual bool processReference(ConfigObjectReference *, const ErrorStack &err=ErrorStack())
Handles references to config objects.
Definition: visitor.cc:198
virtual bool process(Config *config, const ErrorStack &err=ErrorStack())
Traverses the properties of the configuration recursively.
Definition: visitor.cc:17
virtual bool processUnknownType(ConfigItem *item, const QMetaProperty &prop, const ErrorStack &err=ErrorStack())
Handles a property of unknown type.
Definition: visitor.cc:190
virtual bool processDouble(ConfigItem *item, const QMetaProperty &prop, const ErrorStack &err=ErrorStack())
Handles a double precision float typed property.
Definition: visitor.cc:162
virtual bool processUInt(ConfigItem *item, const QMetaProperty &prop, const ErrorStack &err=ErrorStack())
Handles an unsigned integer typed property.
Definition: visitor.cc:155
virtual bool processInterval(ConfigItem *item, const QMetaProperty &prop, const ErrorStack &err=ErrorStack())
Handles a Interval typed property.
Definition: visitor.cc:183
virtual bool processInt(ConfigItem *item, const QMetaProperty &prop, const ErrorStack &err=ErrorStack())
Handles an integer typed property.
Definition: visitor.cc:148
virtual bool processList(AbstractConfigObjectList *list, const ErrorStack &err=ErrorStack())
Traverses the list of objects or references.
Definition: visitor.cc:205
virtual bool processBool(ConfigItem *item, const QMetaProperty &prop, const ErrorStack &err=ErrorStack())
Handles a boolean typed property.
Definition: visitor.cc:134
virtual bool processEnum(ConfigItem *item, const QMetaProperty &prop, const ErrorStack &err=ErrorStack())
Handles an enum typed property.
Definition: visitor.cc:141