eVaf
eVaf::Common::Internal::Registry Class Reference

iRegistry interface implementation. More...

#include <Common/registry.h>

Public Member Functions

virtual QObjectqueryInterface (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 iRegistryinstance ()
 Returns the iRegistry interface instance. More...
 

Detailed Description

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.

Constructor & Destructor Documentation

eVaf::Common::Internal::Registry::Registry ( )
virtual eVaf::Common::Internal::Registry::~Registry ( )
virtual

Member Function Documentation

virtual QObject* eVaf::Common::Internal::Registry::queryInterface ( QString const &  name) const
virtual

Returns the interface by its name.

Parameters
nameName of the interface
Returns
Interface implementation or NULL if not found.

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 bool eVaf::Common::Internal::Registry::registerInterface ( QString const &  name,
QObject obj 
)
virtual

Registers an interface.

Parameters
nameName of the interface
objObject implementing the interface
Returns
True if ok; false if registering failed

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.


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