libdrmconf  0.10.4
A library to program DMR radios.
Public Member Functions | Static Public Member Functions | Protected Attributes | Static Protected Attributes | List of all members
ConfigItem::Context Class Reference

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 ConfigObjectgetObj (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 ConfigObjectgetTag (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...
 

Detailed Description

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.

Member Data Documentation

◆ _tagNames

QHash< QString, QHash< ConfigObject *, QString > > ConfigObject::Context::_tagNames
staticprotected
Initial value:
=
QHash<QString, QHash<ConfigObject *, QString>>()

Maps singleton objects to tags.

◆ _tagObjects

QHash< QString, QHash< QString, ConfigObject * > > ConfigObject::Context::_tagObjects
staticprotected
Initial value:
=
QHash<QString, QHash<QString, ConfigObject *>>()

Maps tags to singleton objects.


The documentation for this class was generated from the following files: