ctkServices Class Reference

#include <Libs/PluginFramework/ctkServices_p.h>

Collaboration diagram for ctkServices:
Collaboration graph
[legend]

List of all members.

Public Member Functions

bool checkServiceClass (QObject *service, const QString &cls) const
void clear ()
 ctkServices (ctkPluginFrameworkContext *fwCtx)
QList< ctkServiceReference * > get (const QString &clazz, const QString &filter) const
ctkServiceReferenceget (ctkPluginPrivate *plugin, const QString &clazz) const
QList< ctkServiceRegistration * > get (const QString &clazz) const
QString getQServiceManagerErrorString (QtMobility::QServiceManager::Error error)
QList< ctkServiceRegistration * > getRegisteredByPlugin (ctkPluginPrivate *p) const
QList< ctkServiceRegistration * > getUsedByPlugin (ctkPlugin *p) const
void registerService (ctkPluginPrivate *plugin, QByteArray serviceDescription)
ctkServiceRegistrationregisterService (ctkPluginPrivate *plugin, const QStringList &classes, QObject *service, const ServiceProperties &properties)
void removeServiceRegistration (ctkServiceRegistration *sr)
void updateServiceRegistrationOrder (ctkServiceRegistration *sr, const QStringList &classes)
 ~ctkServices ()

Static Public Member Functions

static ServiceProperties createServiceProperties (const ServiceProperties &in, const QStringList &classes=QStringList(), long sid=-1)

Public Attributes

QHash< QString, QList
< ctkServiceRegistration * > > 
classServices
ctkPluginFrameworkContextframework
QMutex mutex
QtMobility::QServiceManager qServiceManager
QHash< ctkServiceRegistration
*, QStringList > 
services

Detailed Description

Here we handle all the services that are registered in the framework.

Definition at line 40 of file ctkServices_p.h.


Constructor & Destructor Documentation

ctkServices::ctkServices ( ctkPluginFrameworkContext fwCtx  ) 

Definition at line 85 of file ctkServices.cpp.

ctkServices::~ctkServices (  ) 

Definition at line 91 of file ctkServices.cpp.


Member Function Documentation

bool ctkServices::checkServiceClass ( QObject *  service,
const QString &  cls 
) const

Checks that a given service object is an instance of the given class name.

Parameters:
service The service object to check.
cls The class name to check for.

Definition at line 279 of file ctkServices.cpp.

void ctkServices::clear (  ) 

Definition at line 96 of file ctkServices.cpp.

ServiceProperties ctkServices::createServiceProperties ( const ServiceProperties in,
const QStringList &  classes = QStringList(),
long  sid = -1 
) [static]

Creates a new ServiceProperties object containing in with the keys converted to lower case.

Parameters:
classes A list of class names which will be added to the created ServiceProperties object under the key PluginConstants::OBJECTCLASS.
sid A service id which will be used instead of a default one.

Definition at line 49 of file ctkServices.cpp.

QList< ctkServiceReference * > ctkServices::get ( const QString &  clazz,
const QString &  filter 
) const

Get all services implementing a certain class and then filter these with a property filter.

Parameters:
clazz The class name of requested service.
filter The property filter.
plugin The plugin requesting reference.
Returns:
A list of ctkServiceReference object.

Definition at line 311 of file ctkServices.cpp.

ctkServiceReference * ctkServices::get ( ctkPluginPrivate plugin,
const QString &  clazz 
) const

Get a service implementing a certain class.

Parameters:
plugin The plugin requesting reference
clazz The class name of the requested service.
Returns:
A ctkServiceReference object.

Definition at line 292 of file ctkServices.cpp.

QList< ctkServiceRegistration * > ctkServices::get ( const QString &  clazz  )  const

Get all services implementing a certain class. Only used internally by the framework.

Parameters:
clazz The class name of the requested service.
Returns:
A sorted list of ctkServiceRegistrationPrivate objects.

Definition at line 285 of file ctkServices.cpp.

QString ctkServices::getQServiceManagerErrorString ( QtMobility::QServiceManager::Error  error  ) 
QList< ctkServiceRegistration * > ctkServices::getRegisteredByPlugin ( ctkPluginPrivate p  )  const

Get all services that a plugin has registered.

Parameters:
p The plugin
Returns:
A set of ctkServiceRegistration objects

Definition at line 416 of file ctkServices.cpp.

QList< ctkServiceRegistration * > ctkServices::getUsedByPlugin ( ctkPlugin p  )  const

Get all services that a plugin uses.

Parameters:
p The plugin
Returns:
A set of ctkServiceRegistration objects

Definition at line 433 of file ctkServices.cpp.

void ctkServices::registerService ( ctkPluginPrivate plugin,
QByteArray  serviceDescription 
)

Definition at line 158 of file ctkServices.cpp.

ctkServiceRegistration * ctkServices::registerService ( ctkPluginPrivate plugin,
const QStringList &  classes,
QObject *  service,
const ServiceProperties properties 
)

Register a service in the framework wide register.

Parameters:
plugin The plugin registering the service.
classes The class names under which the service can be located.
service The service object.
properties The properties for this service.
Returns:
A ctkServiceRegistration object.
Exceptions:
std::invalid_argument If one of the following is true:

  • The service object is 0.
  • The service parameter is not a ctkServiceFactory or an instance of all the named classes in the classes parameter.

Definition at line 105 of file ctkServices.cpp.

void ctkServices::removeServiceRegistration ( ctkServiceRegistration sr  ) 

Remove a registered service.

Parameters:
sr The ctkServiceRegistration object that is registered.

Definition at line 394 of file ctkServices.cpp.

void ctkServices::updateServiceRegistrationOrder ( ctkServiceRegistration sr,
const QStringList &  classes 
)

Service ranking changed, reorder registered services according to ranking.

Parameters:
serviceRegistration The ctkServiceRegistrationPrivate object.
rank New rank of object.

Definition at line 267 of file ctkServices.cpp.


Member Data Documentation

Mapping of classname to registered service. The List of registered services are ordered with the highest ranked service first.

Definition at line 73 of file ctkServices_p.h.

Definition at line 76 of file ctkServices_p.h.

QMutex ctkServices::mutex [mutable]

Definition at line 44 of file ctkServices_p.h.

QtMobility::QServiceManager ctkServices::qServiceManager

Definition at line 46 of file ctkServices_p.h.

All registered services in the current framework. Mapping of registered service to class names under which the service is registerd.

Definition at line 66 of file ctkServices_p.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines

Generated on 21 May 2010 for CTK by  doxygen 1.6.1