Eneboo - Documentación para desarrolladores
Métodos públicos estáticos
Referencia de la Clase QComponentFactory

The QComponentFactory class provides static functions to create and register components. Más...

#include <qcomponentfactory_p.h>

Lista de todos los miembros.

Métodos públicos estáticos

static QRESULT createInstance (const QString &cid, const QUuid &iid, QUnknownInterface **instance, QUnknownInterface *outer=0)
static QRESULT registerServer (const QString &filename)
static QRESULT unregisterServer (const QString &filename)
static bool registerComponent (const QUuid &cid, const QString &filename, const QString &name=QString::null, int version=0, const QString &description=QString::null)
static bool unregisterComponent (const QUuid &cid)
static QRESULT createInstance (const QString &cid, const QUuid &iid, QUnknownInterface **instance, QUnknownInterface *outer=0)
static QRESULT registerServer (const QString &filename)
static QRESULT unregisterServer (const QString &filename)
static bool registerComponent (const QUuid &cid, const QString &filename, const QString &name=QString::null, int version=0, const QString &description=QString::null)
static bool unregisterComponent (const QUuid &cid)

Descripción detallada

The QComponentFactory class provides static functions to create and register components.


Documentación de las funciones miembro

QRESULT QComponentFactory::createInstance ( const QString cid,
const QUuid iid,
QUnknownInterface **  iface,
QUnknownInterface outer = 0 
) [static]

Searches for the component identifier cid in the system component registry, loads the corresponding component server and queries for the interface iid. iface is set to the resulting interface pointer. cid can either be the UUID or the name of the component.

The parameter outer is a pointer to the outer interface used for containment and aggregation and is propagated to the createInstance() implementation of the QComponentFactoryInterface in the component server if provided.

The function returns QS_OK if the interface was successfully instantiated, QE_NOINTERFACE if the component does not provide an interface iid, or QE_NOCOMPONENT if there was an error loading the component.

Example:

  QInterfacePtr<MyInterface> iface;
  if ( QComponentFactory::createInstance( IID_MyInterface, CID_MyComponent, (QUnknownInterface**)&iface ) == QS_OK )
      iface->doSomething();
      ...
  }
static QRESULT QComponentFactory::createInstance ( const QString cid,
const QUuid iid,
QUnknownInterface **  instance,
QUnknownInterface outer = 0 
) [static]
bool QComponentFactory::registerComponent ( const QUuid cid,
const QString filepath,
const QString name = QString::null,
int  version = 0,
const QString description = QString::null 
) [static]

Registers the component with id cid in the system component registry and returns TRUE if the component was registerd successfully, otherwise returns FALSE. The component is provided by the component server at filepath and registered with an optional name, version and description.

This function does nothing and returns FALSE if a component with an identical cid does already exist on the system.

A component that has been registered with a name can be created using both the cid and the name value using createInstance().

Call this function for each component in an implementation of registerComponents() .

Ver también:
unregisterComponent(), registerServer(), createInstance()
static bool QComponentFactory::registerComponent ( const QUuid cid,
const QString filename,
const QString name = QString::null,
int  version = 0,
const QString description = QString::null 
) [static]
QRESULT QComponentFactory::registerServer ( const QString filename) [static]

Loads the shared library filename and queries for a QComponentRegistrationInterface. If the library implements this interface, the registerComponents() function is called.

Returns TRUE if the interface is found and successfully called, otherwise returns FALSE.

static QRESULT QComponentFactory::registerServer ( const QString filename) [static]
bool QComponentFactory::unregisterComponent ( const QUuid cid) [static]

Unregisters the component with id cid from the system component registry and returns TRUE if the component was unregistered successfully, otherwise returns FALSE.

Call this function for each component in an implementation of unregisterComponents() .

Ver también:
registerComponent(), unregisterServer()
static bool QComponentFactory::unregisterComponent ( const QUuid cid) [static]
QRESULT QComponentFactory::unregisterServer ( const QString filename) [static]

Loads the shared library filename and queries for a QComponentRegistrationInterface. If the library implements this interface, the unregisterComponents() function is called.

Returns TRUE if the interface is found and successfully unregistered, otherwise returns FALSE.

static QRESULT QComponentFactory::unregisterServer ( const QString filename) [static]

La documentación para esta clase fue generada a partir de los siguientes ficheros:
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'