{
auto it = m_Plugins.find(id);
if(m_Plugins.end() != it)
{
bool bRet = 0;
qDebug(log) << "CreateConnecter id:" << id;
auto plugin = it.value();
if(plugin) {
bRet = QMetaObject::invokeMethod(
plugin,
"CreateConnecter",
Qt::DirectConnection,
Q_ARG(QString, id));
if(!bRet) {
qCritical(log) << "Create CConnecter fail.";
return nullptr;
}
}
if(p) {
int val = 0;
bRet = QMetaObject::invokeMethod(
p,
"Initial",
Qt::DirectConnection,
Q_RETURN_ARG(int, val));
if(!bRet || val) {
qCritical(log) << "Connecter initial fail" << bRet << val;
DeleteConnecter(p);
return nullptr;
}
bRet = QMetaObject::invokeMethod(
p,
"SetParameterClient",
Qt::DirectConnection,
Q_RETURN_ARG(int, val),
if(!bRet || val) {
qCritical(log) << "SetParameterClient fail" << bRet << val;
DeleteConnecter(p);
return nullptr;
}
}
return p;
}
return nullptr;
}
virtual CConnecter * CreateConnecter(const QString &id)
新建 CConnecter 指针,所有者是调用者。 当不在使用时,调用者必调用 DeteleConnecter() 须释放指针。 调用者必须连接信号 CConnecter::sigDisconnecte...
客户端库 (CClient) 参数。仅在客户端库 (CClient) 和插件中使用。