QGIS API Documentation 3.28.0-Firenze (ed3ad0430f)
|
QgsServiceRegistry Class defining the registry manager for QGIS server services. More...
#include <qgsserviceregistry.h>
Public Member Functions | |
QgsServiceRegistry ()=default | |
Constructor. More... | |
~QgsServiceRegistry () | |
Destructor. More... | |
QgsServerApi * | apiForRequest (const QgsServerRequest &request) const |
Searches the API register for an API matching the request and returns a (possibly NULL) pointer to it. More... | |
void | cleanUp () |
Clean up registered service and unregister modules. More... | |
QgsServerApi * | getApi (const QString &name, const QString &version=QString()) |
Retrieves an API from its name. More... | |
QgsService * | getService (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... | |
bool | registerApi (QgsServerApi *api) |
Registers the QgsServerApi api. More... | |
void | registerService (QgsService *service) |
Register a service by its name and version. More... | |
int | unregisterApi (const QString &name, const QString &version=QString()) |
Unregisters API from its name and version. More... | |
int | unregisterService (const QString &name, const QString &version=QString()) |
Unregister service from its name and version. More... | |
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 49 of file qgsserviceregistry.h.
|
default |
Constructor.
QgsServiceRegistry::~QgsServiceRegistry | ( | ) |
Destructor.
Definition at line 84 of file qgsserviceregistry.cpp.
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.
Definition at line 233 of file qgsserviceregistry.cpp.
void QgsServiceRegistry::cleanUp | ( | ) |
Clean up registered service and unregister modules.
Definition at line 352 of file qgsserviceregistry.cpp.
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
name | the name of the API |
version | the version string (optional) |
Definition at line 250 of file qgsserviceregistry.cpp.
QgsService * QgsServiceRegistry::getService | ( | const QString & | name, |
const QString & | version = QString() |
||
) |
Retrieve a service from its name.
name | the name of the service |
version | the version string (optional) |
If the version is not provided the higher version of the service is returned
Definition at line 89 of file qgsserviceregistry.cpp.
void QgsServiceRegistry::init | ( | const QString & | nativeModulepath, |
QgsServerInterface * | serverIface = nullptr |
||
) |
Initialize registry, load modules and auto register services.
serverIface | the server interface |
nativeModulepath | the native module path |
Definition at line 347 of file qgsserviceregistry.cpp.
bool QgsServiceRegistry::registerApi | ( | QgsServerApi * | api | ) |
Registers the QgsServerApi api.
The registry takes ownership of services and will call 'delete' on cleanup
Definition at line 361 of file qgsserviceregistry.cpp.
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
service | a QgsService to be registered |
Definition at line 120 of file qgsserviceregistry.cpp.
int QgsServiceRegistry::unregisterApi | ( | const QString & | name, |
const QString & | version = QString() |
||
) |
Unregisters API from its name and version.
name | the name of the service |
version | (optional) the specific version to unload |
If the version is not specified then all versions from the specified API are unloaded
Definition at line 166 of file qgsserviceregistry.cpp.
int QgsServiceRegistry::unregisterService | ( | const QString & | name, |
const QString & | version = QString() |
||
) |
Unregister service from its name and version.
name | the name of the service |
version | (optional) the specific version to unload |
If the version is not specified then all versions from the specified service are unloaded
Definition at line 281 of file qgsserviceregistry.cpp.