mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-04 00:16:51 +08:00
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:
@@ -9,15 +9,16 @@
|
||||
#define BLACKCORE_CONTEXTSIMULATOR_INTERFACENAME "net.vatsim.PilotClient.BlackCore.ContextSimulator"
|
||||
#define BLACKCORE_CONTEXTSIMULATOR_OBJECTPATH "/Simulator"
|
||||
|
||||
#include "context.h"
|
||||
#include "blackcore/dbus_server.h"
|
||||
#include "blackcore/coreruntime.h"
|
||||
#include "blackcore/context_runtime.h"
|
||||
#include "blackmisc/avaircraft.h"
|
||||
#include <QObject>
|
||||
|
||||
namespace BlackCore
|
||||
{
|
||||
//! \brief Network context
|
||||
class IContextSimulator : public QObject
|
||||
class IContextSimulator : public CContext
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_CLASSINFO("D-Bus Interface", BLACKCORE_CONTEXTSIMULATOR_INTERFACENAME)
|
||||
@@ -38,18 +39,9 @@ namespace BlackCore
|
||||
return s;
|
||||
}
|
||||
|
||||
//! \brief Constructor
|
||||
IContextSimulator(QObject *parent = nullptr) : QObject(parent) {}
|
||||
|
||||
//! Destructor
|
||||
virtual ~IContextSimulator() {}
|
||||
|
||||
/*!
|
||||
* \brief Using local objects?
|
||||
* \return
|
||||
*/
|
||||
virtual bool usingLocalObjects() const = 0;
|
||||
|
||||
signals:
|
||||
//! Emitted when the simulator connection changes
|
||||
void connectionChanged(bool value);
|
||||
@@ -59,9 +51,14 @@ namespace BlackCore
|
||||
//! Returns true when simulator is connected and available
|
||||
virtual bool isConnected() const = 0;
|
||||
|
||||
/*!
|
||||
//! Get user aircraft value object
|
||||
virtual BlackMisc::Aviation::CAircraft getOwnAircraft() const = 0;
|
||||
|
||||
protected:
|
||||
friend class CRuntime;
|
||||
|
||||
//! \brief Constructor
|
||||
IContextSimulator(CRuntimeConfig::ContextMode mode, CRuntime *runtime) : CContext(mode, runtime) {}
|
||||
};
|
||||
|
||||
} // namespace BlackCore
|
||||
|
||||
Reference in New Issue
Block a user