eVaf
iregistry.h File Reference

Common registry for interfaces. More...

#include "libcommon.h"
#include <QObject>
#include <QString>

Go to the source code of this file.

Classes

class  eVaf::Common::iRegistry
 Common registry for interfaces. More...
 

Namespaces

 eVaf
 Global eVaf namespace.
 
 eVaf::Common
 Common eVaf library.
 

Functions

template<typename T >
T * evafQueryInterface (QString const &name)
 Helper function for querying interfaces. More...
 

Detailed Description

Common registry for interfaces.

Author
Enar Vaikene

Copyright (c) 2011 Enar Vaikene

This file is part of the eVaf C++ cross-platform application development framework.

This file can be used under the terms of the GNU General Public License version 3.0 as published by the Free Software Foundation and appearing in the file LICENSE included in the packaging of this file. Please review the the following information to ensure the GNU General Public License version 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html.

Alternatively, this file may be used in accordance with the Commercial License Agreement provided with the Software.

Definition in file iregistry.h.

Function Documentation

template<typename T >
T* evafQueryInterface ( QString const &  name)
inline

Helper function for querying interfaces.

Parameters
nameName of the requested interface
Returns
The requested interface or NULL if not found

This function can be used to query interfaces from the global registry. It returns a properly type-casted interface or NULL if the interface cannot be found or is of an invalid type.

Example:

1 iEnv * env = evafQueryInterface<iEnv>("iEnv");
2 if (env) {
3  // Use the interface
4 }

Definition at line 137 of file iregistry.h.