libdrmconf
0.10.4
A library to program DMR radios.
|
Parse context for config objects. More...
#include <configobject.hh>
Public Member Functions | |
Context () | |
Empty constructor. | |
virtual | ~Context () |
Destructor. | |
const QString & | version () const |
Returns the read version string. | |
void | setVersion (const QString &ver) |
Sets the version string. | |
virtual bool | contains (ConfigObject *obj) const |
Returns true , if the context contains the given object. | |
virtual bool | contains (const QString &id) const |
Returns true , if the context contains the given ID. | |
virtual QString | getId (ConfigObject *obj) const |
Returns ID of the given object. | |
virtual ConfigObject * | getObj (const QString &id) const |
Returns the object for the given ID. | |
virtual bool | add (const QString &id, ConfigObject *) |
Associates the given object with the given ID. | |
Static Public Member Functions | |
static bool | hasTag (const QString &className, const QString &property, const QString &tag) |
Returns true if the property of the class has the specified tag associated. | |
static bool | hasTag (const QString &className, const QString &property, ConfigObject *obj) |
Returns true if the property of the class has the specified object as a tag associated. | |
static ConfigObject * | getTag (const QString &className, const QString &property, const QString &tag) |
Returns the object associated with the tag for the property of the class. | |
static QString | getTag (const QString &className, const QString &property, ConfigObject *obj) |
Returns the tag associated with the object for the property of the class. | |
static void | setTag (const QString &className, const QString &property, const QString &tag, ConfigObject *obj) |
Associates the given object with the tag for the property of the given class. | |
Protected Attributes | |
QString | _version |
The version string. | |
QHash< QString, ConfigObject * > | _objects |
ID->OBJ look-up table. | |
QHash< ConfigObject *, QString > | _ids |
OBJ->ID look-up table. | |
Static Protected Attributes | |
static QHash< QString, QHash< QString, ConfigObject * > > | _tagObjects |
Maps tags to singleton objects. More... | |
static QHash< QString, QHash< ConfigObject *, QString > > | _tagNames |
Maps singleton objects to tags. More... | |
Parse context for config objects.
During serialization, each config object gets an ID assigned. When reading the config, these IDs must be matched back to the corresponding objects. This is done using this context.
|
staticprotected |
Maps singleton objects to tags.
|
staticprotected |
Maps tags to singleton objects.