refs #199 , adjusted context classes

* removed usingLocalObjects() now in CContext
* removed getRuntime() now in CContext
* Constructors no longer public, context can only be obtained via runtime object
* runtime class is friend class
This commit is contained in:
Klaus Basan
2014-04-01 11:48:45 +02:00
parent 0b033fdcac
commit 77fd3bcd70
28 changed files with 161 additions and 290 deletions

View File

@@ -7,12 +7,12 @@
#define BLACKCORE_CONTEXTAPPLICATION_IMPL_H
#include "context_application.h"
#include "coreruntime.h"
#include "context_runtime.h"
#include "dbus_server.h"
namespace BlackCore
{
class CCoreRuntime;
class CRuntime;
/*!
* \brief Application context
@@ -24,11 +24,8 @@ namespace BlackCore
public:
/*!
* Context
* \param parent
*/
CContextApplication(QObject *parent = nullptr);
//! Constructor
CContextApplication(CRuntimeConfig::ContextMode mode, CRuntime *runtime = nullptr);
//! Destructor
virtual ~CContextApplication() {}
@@ -37,24 +34,7 @@ namespace BlackCore
CContextApplication *registerWithDBus(CDBusServer *server)
{
server->addObject(IContextApplication::ObjectPath(), this);
}
/*!
* \brief Runtime
* \return
*/
CCoreRuntime *getRuntime()
{
return static_cast<CCoreRuntime *>(this->parent());
}
/*!
* \brief Const runtime
* \return
*/
const CCoreRuntime *getRuntime() const
{
return static_cast<CCoreRuntime *>(this->parent());
return this;
}
public slots: