QGIS API Documentation 3.41.0-Master (3440c17df1d)
Loading...
Searching...
No Matches
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
 
 ~QgsServiceRegistry ()
 
QgsServerApiapiForRequest (const QgsServerRequest &request) const
 Searches the API register for an API matching the request and returns a (possibly NULL) pointer to it.
 
void cleanUp ()
 Clean up registered service and unregister modules.
 
QgsServerApigetApi (const QString &name, const QString &version=QString())
 Retrieves an API from its name.
 
QgsServicegetService (const QString &name, const QString &version=QString())
 Retrieve a service from its name.
 
void init (const QString &nativeModulepath, QgsServerInterface *serverIface=nullptr)
 Initialize registry, load modules and auto register services.
 
bool registerApi (QgsServerApi *api)
 Registers the QgsServerApi api.
 
void registerService (QgsService *service)
 Register a service by its name and version.
 
int unregisterApi (const QString &name, const QString &version=QString())
 Unregisters API from its name and version.
 
int unregisterService (const QString &name, const QString &version=QString())
 Unregister service from its name and version.
 

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

Definition at line 48 of file qgsserviceregistry.h.

Constructor & Destructor Documentation

◆ QgsServiceRegistry()

QgsServiceRegistry::QgsServiceRegistry ( )
default

◆ ~QgsServiceRegistry()

QgsServiceRegistry::~QgsServiceRegistry ( )

Definition at line 84 of file qgsserviceregistry.cpp.

Member Function Documentation

◆ apiForRequest()

QgsServerApi * QgsServiceRegistry::apiForRequest ( const QgsServerRequest request) const

Searches the API register for an API matching the request and returns a (possibly NULL) pointer to it.

Since
QGIS 3.10

Definition at line 233 of file qgsserviceregistry.cpp.

◆ cleanUp()

void QgsServiceRegistry::cleanUp ( )

Clean up registered service and unregister modules.

Definition at line 352 of file qgsserviceregistry.cpp.

◆ getApi()

QgsServerApi * QgsServiceRegistry::getApi ( const QString &  name,
const QString &  version = QString() 
)

Retrieves an API from its name.

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

Parameters
namethe name of the API
versionthe version string (optional)
Returns
QgsServerApi
Since
QGIS 3.10

Definition at line 250 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 89 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 347 of file qgsserviceregistry.cpp.

◆ registerApi()

bool QgsServiceRegistry::registerApi ( QgsServerApi api)

Registers the QgsServerApi api.

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

Since
QGIS 3.10

Definition at line 361 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 takes ownership of services and will call 'delete' on cleanup

Parameters
servicea QgsService to be registered

Definition at line 120 of file qgsserviceregistry.cpp.

◆ unregisterApi()

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

Unregisters API from its name and version.

Parameters
namethe name of the service
version(optional) the specific version to unload
Returns
the number of APIs unregistered

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

Since
QGIS 3.10

Definition at line 166 of file qgsserviceregistry.cpp.

◆ unregisterService()

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

Unregister service from its name and version.

Parameters
namethe name 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 281 of file qgsserviceregistry.cpp.


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