60 QDir moduleDir( modulePath );
61 moduleDir.setSorting( QDir::Name | QDir::IgnoreCase );
62 moduleDir.setFilter( QDir::Files );
64 #if defined(Q_OS_WIN) || defined(__CYGWIN__) 65 moduleDir.setNameFilters( QStringList(
"*.dll" ) );
67 moduleDir.setNameFilters( QStringList(
"*.so" ) );
70 qDebug() << QString(
"Checking %1 for native services modules" ).arg( moduleDir.path() );
73 for (
const QFileInfo &fi : moduleDir.entryInfoList() )
95 QLibrary lib( location );
97 qDebug() << QString(
"Loading native module %1" ).arg( location );
107 if ( entryPointFunc )
117 mModules.insert( location, ModuleTable::mapped_type( entry ) );
137 ModuleTable::iterator it = mModules.begin();
138 ModuleTable::iterator end = mModules.end();
142 unloadModuleEntry( it->get() );
152 ModuleTable::iterator item = mModules.find( location );
153 if ( item != mModules.end() )
QgsServiceModule * loadNativeModule(const QString &location)
Load the native module from path.
QgsServiceModule * serviceEntryPoint_t()
QgsServiceModule * mModule
QgsServiceNativeModuleEntry(const QString &location)
Constructor for QgsServiceNativeModuleEntry.
Class defining the service module interface for QGIS server services.
void unloadModules()
Unload all modules.
unloadHook_t * mUnloadHook
static void logMessage(const QString &message, const QString &tag=QString(), Qgis::MessageLevel level=Qgis::Warning, bool notifyUser=true)
Adds a message to the log instance (and creates it if necessary).
virtual void registerSelf(QgsServiceRegistry ®istry, QgsServerInterface *serverIface=nullptr)=0
Asks the module to register all provided services.
void unloadHook_t(QgsServiceModule *)
QgsServerInterface Class defining interfaces exposed by QGIS Server and made available to plugins...
QgsServiceRegistry Class defining the registry manager for QGIS server services.
Native module (location, the module itself and the unload function).
void loadModules(const QString &modulePath, QgsServiceRegistry ®istrar, QgsServerInterface *serverIface=nullptr)
Load all modules from path.