Ref T312, simulator factory not copyable plus check function (bypassing timer)

This commit is contained in:
Klaus Basan
2018-08-27 14:18:14 +02:00
parent d212d16929
commit 1d7b3bd180
2 changed files with 24 additions and 3 deletions

View File

@@ -1145,4 +1145,10 @@ namespace BlackCore
this->stopImpl();
m_isRunning = false;
}
void ISimulatorListener::check()
{
if (!m_isRunning) { return; }
this->checkImpl();
}
} // namespace

View File

@@ -584,9 +584,6 @@ namespace BlackCore
//! Info about the backend system (if available)
virtual QString backendInfo() const;
//! Overall (swift) application shutting down
virtual bool isShuttingDown() const;
public slots:
//! Start listening for the simulator to start.
void start();
@@ -594,6 +591,9 @@ namespace BlackCore
//! Stops listening.
void stop();
//! Check simulator availability
void check();
signals:
//! Emitted when the listener discovers the simulator running.
void simulatorStarted(const BlackMisc::Simulation::CSimulatorPluginInfo &info);
@@ -603,12 +603,18 @@ namespace BlackCore
//! \sa ISimulatorFactory::createListener().
ISimulatorListener(const BlackMisc::Simulation::CSimulatorPluginInfo &info);
//! Overall (swift) application shutting down
virtual bool isShuttingDown() const;
//! Plugin specific implementation to start listener
virtual void startImpl() = 0;
//! Plugin specific implementation to stop listener
virtual void stopImpl() = 0;
//! Plugin specific implementation to check
virtual void checkImpl() = 0;
private:
BlackMisc::Simulation::CSimulatorPluginInfo m_info;
bool m_isRunning = false;
@@ -621,6 +627,11 @@ namespace BlackCore
//! ISimulatorVirtual destructor
virtual ~ISimulatorFactory() {}
//! Not copyable @{
ISimulatorFactory(const ISimulatorFactory &) = delete;
ISimulatorFactory &operator=(const ISimulatorFactory &) = delete;
//! @}
//! Create a new instance of a driver
//! \param info metadata about simulator
//! \param ownAircraftProvider in memory access to own aircraft data
@@ -638,6 +649,10 @@ namespace BlackCore
//! Simulator listener instance
virtual ISimulatorListener *createListener(const BlackMisc::Simulation::CSimulatorPluginInfo &info) = 0;
protected:
//! Default ctor
ISimulatorFactory() {}
};
} // namespace