125 lines
4.0 KiB
C++
Executable File
125 lines
4.0 KiB
C++
Executable File
|
|
// **************************************************************************
|
|
//
|
|
// (C) Copyright 2009 Swiss SIMTEC AG
|
|
//
|
|
// **************************************************************************
|
|
//
|
|
// $HeadURL$
|
|
// $LastChangedBy$
|
|
// $LastChangedDate$
|
|
// $LastChangedRevision$
|
|
//
|
|
// **************************************************************************
|
|
|
|
// manual class headers
|
|
#include "GeoPairingImplFactory.hpp"
|
|
#include "GeoPairingImplDummy.hpp"
|
|
|
|
using N_GeoPairingImpl::GeoPairingImplFactory;
|
|
|
|
namespace N_GeoPairingImpl
|
|
{
|
|
|
|
// static member initialization
|
|
GeoPairingImpl *GeoPairingImplFactory::m_Impl = nullptr;
|
|
|
|
|
|
|
|
// ---------------------------------------------------------------
|
|
// Creates a new air target tracker
|
|
// ---------------------------------------------------------------
|
|
GeoPairingImplAirTargetTracker *GeoPairingImplFactory::createAirTargetTracker()
|
|
{
|
|
return getImpl()->createAirTargetTracker();
|
|
}
|
|
|
|
|
|
// ---------------------------------------------------------------
|
|
// Creates a new air target updater
|
|
// ---------------------------------------------------------------
|
|
GeoPairingImplAirTargetUpdater *GeoPairingImplFactory::createAirTargetUpdater()
|
|
{
|
|
return getImpl()->createAirTargetUpdater();
|
|
}
|
|
|
|
|
|
// ---------------------------------------------------------------
|
|
// Creates a new air target cache
|
|
// ---------------------------------------------------------------
|
|
GeoPairingImplAirTargetCache *GeoPairingImplFactory::createAirTargetCache(SInt32 a_playerID)
|
|
{
|
|
return getImpl()->createAirTargetCache(a_playerID);
|
|
}
|
|
|
|
|
|
// ---------------------------------------------------------------
|
|
// Creates a new fired bulled according to the given SensorData
|
|
// ---------------------------------------------------------------
|
|
GeoPairingImplFiredBullet *GeoPairingImplFactory::createFiredBullet(GeoPairingImplSensorData &a_sensorData)
|
|
{
|
|
return getImpl()->createFiredBullet(a_sensorData);
|
|
}
|
|
|
|
|
|
// ---------------------------------------------------------------
|
|
// Populates a SensorData instance according to the given
|
|
// transparent datastream
|
|
// ---------------------------------------------------------------
|
|
SInt32 GeoPairingImplFactory::createSensorData(GeoPairingImplSensorData *a_sensorData, const QByteArray& a_transparentData, int &isDefault)
|
|
{
|
|
return getImpl()->createSensorData(a_sensorData, a_transparentData, isDefault);
|
|
}
|
|
|
|
SInt32 GeoPairingImplFactory::createSensorData(GeoPairingImplSensorData *a_sensorData, const QByteArray& a_transparentData)
|
|
{
|
|
int isDefault;
|
|
return getImpl()->createSensorData(a_sensorData, a_transparentData, isDefault);
|
|
}
|
|
|
|
// ---------------------------------------------------------------
|
|
// retrieves the implementation object pointer
|
|
// ---------------------------------------------------------------
|
|
GeoPairingImpl *GeoPairingImplFactory::getImpl()
|
|
{
|
|
if (m_Impl == nullptr)
|
|
m_Impl = new GeoPairingImplDummy;
|
|
return m_Impl;
|
|
}
|
|
|
|
|
|
// ---------------------------------------------------------------
|
|
// Initialize the GeoPairing component
|
|
// ---------------------------------------------------------------
|
|
bool GeoPairingImplFactory::initialize(const QString &filePath)
|
|
{
|
|
return getImpl()->initialize(filePath);
|
|
}
|
|
|
|
|
|
// ---------------------------------------------------------------
|
|
// installs an implementation
|
|
// ---------------------------------------------------------------
|
|
void GeoPairingImplFactory::setImpl(GeoPairingImpl *a_impl)
|
|
{
|
|
NGL::INGLLogger &l = (CesGeoPairing::getLogger("Plugin.GeoPairing.GeoPairingImplFactory"));
|
|
if (m_Impl != nullptr)
|
|
{
|
|
INFO_LOG(l) << "Destroying existing instance of Implementation first";
|
|
delete m_Impl;
|
|
}
|
|
m_Impl = a_impl;
|
|
INFO_LOG(l) << "New Implementation installed";
|
|
}
|
|
|
|
|
|
// ---------------------------------------------------------------
|
|
// Sets global meteo conditions
|
|
// ---------------------------------------------------------------
|
|
void GeoPairingImplFactory::setMeteoData(const GeoPairingImplMeteoData &a_meteoData)
|
|
{
|
|
getImpl()->setMeteoData(a_meteoData);
|
|
}
|
|
|
|
} // namespace N_GeoPairingImpl
|