mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-04 16:56:53 +08:00
refs #250, helper methods
* in aircraft class to compare COM * in context / runtime component to check vitality of core
This commit is contained in:
@@ -398,6 +398,20 @@ namespace BlackCore
|
||||
m_init = true;
|
||||
}
|
||||
|
||||
bool CRuntime::hasRemoteApplicationContext() const
|
||||
{
|
||||
Q_ASSERT(this->m_contextApplication);
|
||||
return !this->m_contextApplication->usingLocalObjects();
|
||||
}
|
||||
|
||||
bool CRuntime::canPingApplicationContext() const
|
||||
{
|
||||
Q_ASSERT(this->m_contextApplication);
|
||||
if (this->m_contextApplication->usingLocalObjects()) return true;
|
||||
qint64 token = QDateTime::currentMSecsSinceEpoch();
|
||||
return (token == this->m_contextApplication->ping(token));
|
||||
}
|
||||
|
||||
void CRuntime::initDBusServer(const QString &dBusAddress)
|
||||
{
|
||||
if (this->m_dbusServer) return;
|
||||
|
||||
@@ -187,6 +187,11 @@ namespace BlackCore
|
||||
//! Init
|
||||
void init(const CRuntimeConfig &config);
|
||||
|
||||
//! Remote application context, indicates distributed environment
|
||||
bool hasRemoteApplicationContext() const;
|
||||
|
||||
//! Is application context available?
|
||||
bool canPingApplicationContext() const;
|
||||
|
||||
private:
|
||||
bool m_init; /*!< flag */
|
||||
|
||||
Reference in New Issue
Block a user