Qt Mobility Reference Documentation

QRemoteServiceClassRegister Class Reference

The QRemoteServiceClassRegister class manages the various remote service classes which can be instantiated. More...

 #include <QRemoteServiceClassRegister>

Public Types

enum InstanceType { SharedInstance, UniqueInstance }

Public Functions

QList<QRemoteServiceIdentifier> types () const

Static Public Members

bool registerType ( QRemoteServiceClassRegister::InstanceType type = UniqueInstance )

Macros

Q_SERVICE ( T, name, interface, version )

Detailed Description

The QRemoteServiceClassRegister class manages the various remote service classes which can be instantiated.


Member Type Documentation

enum QRemoteServiceClassRegister::InstanceType

Defines the possible service instanciation methodologies.

ConstantValueDescription
QRemoteServiceClassRegister::SharedInstance0Each new request for this service receives a reference to the same service object instance. This can be compared with a singleton pattern.
QRemoteServiceClassRegister::UniqueInstance1A new service object instance is created for each new client requesting a reference to the service.

Member Function Documentation

bool QRemoteServiceClassRegister::registerType ( QRemoteServiceClassRegister::InstanceType type = UniqueInstance ) [static]

This template function registers the provided template class as remote service and returns true if the registration was successfull. The type specifies the method used for service class instanciation.

 QRemoteServiceClassRegister::registerType<ServiceClass>();

Every service class must be marked via the Q_SERVICE() macro.

QList<QRemoteServiceIdentifier> QRemoteServiceClassRegister::types () const

Returns the list of all registered service types.


Macro Documentation

Q_SERVICE ( T, name, interface, version )

This macro marks a class as remote service and should be placed next to the Q_OBJECT macro. T represents the name of the class implementing the service, name specifies name under which the service is registered, interface name and version represents the interface version. All parameters must match the interface information provided by the associated service XML file.

 class ServiceClass : public QObject
 {
     Q_OBJECT
     Q_SERVICE(ServiceClass, "ServiceName", "com.nokia.qt.interfacename", "1.2");
 public:
     ServiceClass(QObject* parent) : QObject(parent) {};
 public slots:
     void serviceCall();
 };
X

Thank you for giving your feedback.

Make sure it is related to this specific page. For more general bugs and requests, please use the Qt Bug Tracker.