refs #199, convenience methods for easier initializations

This commit is contained in:
Klaus Basan
2014-04-08 14:58:12 +02:00
parent 8b8a1d44b3
commit 760376d848
2 changed files with 22 additions and 1 deletions

View File

@@ -262,6 +262,24 @@ namespace BlackCore
return static_cast<CContextSimulator *>(this->m_contextSimulator);
}
bool CRuntimeConfig::requiresDBusSever() const
{
return (this->m_application == LocalInDbusServer ||
this->m_audio == LocalInDbusServer ||
this->m_network == LocalInDbusServer ||
this->m_settings == LocalInDbusServer ||
this->m_simulator == LocalInDbusServer);
}
bool CRuntimeConfig::requiresDBusConnection() const
{
return (this->m_application == Remote ||
this->m_audio == Remote ||
this->m_network == Remote ||
this->m_settings == Remote ||
this->m_simulator == Remote);
}
const CRuntimeConfig &CRuntimeConfig::forCore()
{
static CRuntimeConfig cfg = CRuntimeConfig(CRuntimeConfig(CRuntimeConfig::LocalInDbusServer));

View File

@@ -48,6 +48,10 @@ namespace BlackCore
ContextMode getModeApplication() const { return this->m_application; }
//! local settings?
bool hasLocalSettings() const { return this->m_settings == Local || this->m_settings == LocalInDbusServer; }
//! requires server (at least one in server)?
bool requiresDBusSever() const;
//! requires DBus connection (at least one remote)?
bool requiresDBusConnection() const;
//! predefined for Core
static const CRuntimeConfig &forCore();
@@ -57,7 +61,6 @@ namespace BlackCore
//! predefined, completely remote (e.g. for GUI with core)
static const CRuntimeConfig &remote();
};
}
#endif // guard