eVaf
|
iRegistry interface implementation. More...
#include <Common/registry.h>
Public Member Functions | |
virtual QObject * | queryInterface (QString const &name) const |
Returns the interface by its name. More... | |
virtual bool | registerInterface (QString const &name, QObject *obj) |
Registers an interface. More... | |
Registry () | |
virtual | ~Registry () |
Public Member Functions inherited from eVaf::Common::iRegistry | |
iRegistry () | |
Interface constructor. More... | |
virtual | ~iRegistry () |
Empty virtual destructor. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from eVaf::Common::iRegistry | |
static iRegistry * | instance () |
Returns the iRegistry interface instance. More... | |
iRegistry interface implementation.
This class implements the global registry for interfaces. Interfaces are stored in a QHash container and quarded with QWeakPointer.
Definition at line 39 of file registry.h.
eVaf::Common::Internal::Registry::Registry | ( | ) |
|
virtual |
|
virtual |
Returns the interface by its name.
name | Name of the interface |
This function queries the global registry for the interface by its name. It returns a pointer to the implementation of the interface or NULL if no such interface is found.
Use the qobject_cast<>() function to type cast the returned pointer to the required interface class. Always check for NULL in case there is a mismatch in interface versions or no such interface is found.
Implements eVaf::Common::iRegistry.
|
virtual |
Registers an interface.
name | Name of the interface |
obj | Object implementing the interface |
This function registers a new interface in the global registry of interfaces.
If an interface with this name already exists, then the new interface implementation overwrites the old implementation.
Implements eVaf::Common::iRegistry.