QGIS API Documentation  3.8.0-Zanzibar (11aff65)
Public Member Functions | List of all members
QgsServiceRegistry Class Reference

QgsServiceRegistry Class defining the registry manager for QGIS server services. More...

#include <qgsserviceregistry.h>

Public Member Functions

 QgsServiceRegistry ()=default
 Constructor. More...
 
 ~QgsServiceRegistry ()
 Destructor. More...
 
void cleanUp ()
 Clean up registered service and unregister modules. More...
 
QgsServicegetService (const QString &name, const QString &version=QString())
 Retrieve a service from its name. More...
 
void init (const QString &nativeModulepath, QgsServerInterface *serverIface=nullptr)
 Initialize registry, load modules and auto register services. More...
 
void registerService (QgsService *service)
 Register a service by its name and version. More...
 
int unregisterService (const QString &name, const QString &version=QString())
 Unregister service from its name and version. More...
 

Detailed Description

QgsServiceRegistry Class defining the registry manager for QGIS server services.

This class provides methods for registering and retrieving services.

IMPORTANT: The registry hold ownership of registered services and will call 'delete' on cleanup

Since
QGIS 3.0

Definition at line 47 of file qgsserviceregistry.h.

Constructor & Destructor Documentation

◆ QgsServiceRegistry()

QgsServiceRegistry::QgsServiceRegistry ( )
default

Constructor.

◆ ~QgsServiceRegistry()

QgsServiceRegistry::~QgsServiceRegistry ( )

Destructor.

Definition at line 83 of file qgsserviceregistry.cpp.

Member Function Documentation

◆ cleanUp()

void QgsServiceRegistry::cleanUp ( )

Clean up registered service and unregister modules.

Definition at line 230 of file qgsserviceregistry.cpp.

◆ getService()

QgsService * QgsServiceRegistry::getService ( const QString &  name,
const QString &  version = QString() 
)

Retrieve a service from its name.

Parameters
namethe name of the service
versionthe version string (optional)
Returns
QgsService

If the version is not provided the higher version of the service is returned

Definition at line 88 of file qgsserviceregistry.cpp.

◆ init()

void QgsServiceRegistry::init ( const QString &  nativeModulepath,
QgsServerInterface serverIface = nullptr 
)

Initialize registry, load modules and auto register services.

Parameters
serverIfacethe server interface
nativeModulepaththe native module path

Definition at line 225 of file qgsserviceregistry.cpp.

◆ registerService()

void QgsServiceRegistry::registerService ( QgsService service)

Register a service by its name and version.

This method is intended to be called by modules for registering services. A module may register multiple services.

The registry gain ownership of services and will call 'delete' on cleanup

Parameters
servicea QgsService to be registered

Definition at line 117 of file qgsserviceregistry.cpp.

◆ unregisterService()

int QgsServiceRegistry::unregisterService ( const QString &  name,
const QString &  version = QString() 
)

Unregister service from its name and version.

Parameters
namethe tame of the service
version(optional) the specific version to unload
Returns
the number of services unregistered

If the version is not specified then all versions from the specified service are unloaded

Definition at line 161 of file qgsserviceregistry.cpp.


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