|
| CuModuleLoader () |
|
| CuModuleLoader (CumbiaPool *cu_pool, CuControlsFactoryPool *ctrl_f_pool, CuLogImplI *log_impl) |
| Class constructor. Detects available modules and loads them according to command line options. More...
|
|
virtual | ~CuModuleLoader () |
|
CuLog * | log () const |
|
QStringList | modules () const |
|
QString | msg () const |
|
bool | error () const |
|
bool | switch_engine (int engine, CumbiaPool *cu_pool, CuControlsFactoryPool &m_ctrl_factory_pool, QList< QObject * > &objs) |
|
bool | switch_engine (int engine, CumbiaPool *cu_pool, CuControlsFactoryPool &m_ctrl_factory_pool, QObject *root) |
|
bool | m_prepare_switch (int engine, CumbiaPool *cu_pool, CuControlsFactoryPool &m_ctrl_factory_pool, std::vector< Cumbia * > &cumbias) |
|
int | m_apply_switch (const QList< QObject * > objs, CumbiaPool *cu_pool, const CuControlsFactoryPool &m_ctrl_factory_pool) |
|
int | m_delete_cumbias (const std::vector< Cumbia * > &vc) |
|
int | engine_type (const CuContext *ctx) const |
|
bool | same_engine (CumbiaPool *cu_pool, int engine) const |
|
std::vector< Cumbia * > | m_clear_cumbia (CumbiaPool *cu_pool, CuControlsFactoryPool &fp) |
|
Find and load installed cumbia modules.
- Foreword
- In this documentation, the words module, engine, domain are synonyms.
CuModuleLoader detects the installed cumbia modules, such as cumbia-tango, cumbia-epics, cumbia-websocket, cumbia-http, cumbia-random. In order to be found, each module must have been compiled and installed either through the scripts/cubiuild.sh automatic procedure or manually.
To get the list of searched modules for the current cumbia version, inspect quapps.pri.
- Usage
- The application Qt project file (*.pro*) shall include $${CUMBIA_ROOT}/include/quapps/quapps.pri instead of an engine specific *.pri* project include file, for examaple qumbia-tango-controls.pri.
Including quapps.pri in your project *.pro* file and using CuModuleLoader allows engine auto detection and loading.
- Loading precedence.
- cumbia-websocket: search a websocket url option, -u ws://websocket.url or -u wss://websocket.secure.url.
- cumbia-http: search a http url option, -u http://my.http.url/channel_name, or the https counterpart. Note the channel_name that must be specified after the server url, where Server Sent Events are published.
cumbia-websocket and cumbia-http are mutually exclusive. If either is loaded, module search stops. This lets the same application work seamlessly across different engines without changing its code.
- all remaining modules can coexist, for example both EPICS and Tango modules can be loaded allowing apps to connect to the engines natively. They can coexist because different engine sources are expected to have different forms.
CuModuleLoader::CuModuleLoader |
( |
CumbiaPool * |
cu_pool, |
|
|
CuControlsFactoryPool * |
ctrl_f_pool, |
|
|
CuLogImplI * |
log_impl |
|
) |
| |
|
inline |
Class constructor. Detects available modules and loads them according to command line options.
- Parameters
-
cu_pool | pointer to a valid CumbiaPool. Ownership is not taken. |
ctrl_f_pool | pointer to a valid CuControlsFactoryPool. Ownership is not taken |
log_impl | pointer to a valid CuLogImplI implementation. Ownership is not taken. |
Modules listed in quapps.pri are searched. If found, they are loaded.
- Http and websocket modules
- If the -u command line argument is followed by an URL, either a http/https or a ws/wss URL is expected. In the former case, the URL of the server must be followed by a channel name, used for the publisher/subscriber communication.
If -u + url is detected, one of cumbia-http or cumbia-websocket modules is loaded. Since a cumbia application is studied to rely on any supported engine at runtime transparently, no other modules are loaded after either http or websocket. They indeed share the same source syntax as the native engines.
If no URL is provided, all the other available engines are loaded.
Parameters cu_pool and ctrl_f_pool must be valid. If log_impl is null, then no CuLog service is instantiated and registered. If log_impl is not null, a CuLog is created for you with the given CuLogImplI instance, and can be fetched with the CuModuleLoader::log method. If a CuLog is instantiated, it will be deleted together with CuModuleLoader.
The CuModuleLoader::modules method returns the list of modules (or, equivalently engines, domains) loaded.