refs #358, split FSX driver and factory into different files

This commit is contained in:
Klaus Basan
2014-12-15 00:17:21 +01:00
parent f426c58488
commit def17124db
3 changed files with 80 additions and 10 deletions

View File

@@ -33,16 +33,6 @@ namespace BlackSimPlugin
{
namespace Fsx
{
BlackCore::ISimulator *CSimulatorFsxFactory::create(QObject *parent)
{
return new Fsx::CSimulatorFsx(parent);
}
BlackSim::CSimulatorInfo CSimulatorFsxFactory::getSimulatorInfo() const
{
return CSimulatorInfo::FSX();
}
CSimulatorFsx::CSimulatorFsx(QObject *parent) :
ISimulator(parent),
m_simulatorInfo(CSimulatorInfo::FSX()),

View File

@@ -0,0 +1,35 @@
/* Copyright (C) 2013
* swift Project Community / Contributors
*
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
* including this file, may be copied, modified, propagated, or distributed except according to the terms
* contained in the LICENSE file.
*/
#include "simulator_fsxfactory.h"
#include "simulator_fsx.h"
#include "blacksim/simulatorinfo.h"
#include "blackmisc/project.h"
#include <QTimer>
#include <QtConcurrent>
using namespace BlackSim;
using namespace BlackCore;
namespace BlackSimPlugin
{
namespace Fsx
{
BlackCore::ISimulator *CSimulatorFsxFactory::create(QObject *parent)
{
return new Fsx::CSimulatorFsx(parent);
}
CSimulatorInfo CSimulatorFsxFactory::getSimulatorInfo() const
{
return CSimulatorInfo::FSX();
}
} // namespace
} // namespace

View File

@@ -0,0 +1,45 @@
/* Copyright (C) 2013
* swift Project Community / Contributors
*
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
* including this file, may be copied, modified, propagated, or distributed except according to the terms
* contained in the LICENSE file.
*/
//! \file
#ifndef BLACKSIMPLUGIN_SIMULATOR_FSXFACTORY_H
#define BLACKSIMPLUGIN_SIMULATOR_FSXFACTORY_H
#include "blackcore/simulator.h"
#include "blacksim/simulatorinfo.h"
#include <simconnect/SimConnect.h>
#include <QObject>
#include <QtPlugin>
namespace BlackSimPlugin
{
namespace Fsx
{
//! Factory implementation to create CSimulatorFsx instances
class CSimulatorFsxFactory : public QObject, public BlackCore::ISimulatorFactory
{
Q_OBJECT
// TODO: @RW, move this string into CProject please
Q_PLUGIN_METADATA(IID "net.vatsim.PilotClient.BlackCore.SimulatorInterface")
Q_INTERFACES(BlackCore::ISimulatorFactory)
public:
//! \copydoc BlackCore::ISimulatorFactory::create
virtual BlackCore::ISimulator *create(QObject *parent) override;
//! \copydoc BlackCore::ISimulatorFactory::getSimulatorInfo
virtual BlackSim::CSimulatorInfo getSimulatorInfo() const override;
};
} // namespace
} // namespace
#endif // guard