Commit 49dc7f0d authored by Pascal Palenda's avatar Pascal Palenda
Browse files

Start implementing a template factory

parent 2fdc7734
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
// simulation scheduler includes // simulation scheduler includes
#include <ITA/SimulationScheduler/config_interface.h> #include <ITA/SimulationScheduler/config_interface.h>
#include <ITA/SimulationScheduler/factory.h>
// std includes // std includes
#include <memory> #include <memory>
...@@ -50,7 +51,7 @@ namespace ITA ...@@ -50,7 +51,7 @@ namespace ITA
/// ///
/// \brief Base configuration class for audibility filter. /// \brief Base configuration class for audibility filter.
/// ///
/// \note ::sFilterType is a read only property of the AudibilityFilterConfig. /// \note ::sType is a read only property of the AudibilityFilterConfig.
/// Due to this the copy constructor and assignment operator are needed. /// Due to this the copy constructor and assignment operator are needed.
/// ///
struct ITA_SIMULATION_SCHEDULER_API AudibilityFilterConfig : public IConfig struct ITA_SIMULATION_SCHEDULER_API AudibilityFilterConfig : public IConfig
...@@ -65,7 +66,7 @@ namespace ITA ...@@ -65,7 +66,7 @@ namespace ITA
std::string sFilterName = "Unknown"; std::string sFilterName = "Unknown";
const std::string& sFilterType; const std::string& sType;
std::vector<std::string> sNextFilter; std::vector<std::string> sNextFilter;
...@@ -100,6 +101,9 @@ namespace ITA ...@@ -100,6 +101,9 @@ namespace ITA
static void CheckUpdateTimestamp ( const CUpdateScene& previousState, const CUpdateScene& newUpdate ); static void CheckUpdateTimestamp ( const CUpdateScene& previousState, const CUpdateScene& newUpdate );
}; };
typedef CFactory<IAudibilityFilter, IAudibilityFilter::AudibilityFilterConfig> ITA_SIMULATION_SCHEDULER_API CAudibilityFilterFactory;
/*
/// ///
/// \brief Factory class for filter. /// \brief Factory class for filter.
/// ///
...@@ -154,7 +158,11 @@ namespace ITA ...@@ -154,7 +158,11 @@ namespace ITA
/// ///
static std::map<std::string, std::pair<CreateCallback, ConfigCreateCallback>> m_mFilters; static std::map<std::string, std::pair<CreateCallback, ConfigCreateCallback>> m_mFilters;
}; };
*/
} // namespace AudibilityFilter } // namespace AudibilityFilter
ENABLE_FACTORY ( AudibilityFilter::IAudibilityFilter::AudibilityFilterConfig );
} // namespace SimulationScheduler } // namespace SimulationScheduler
} // namespace ITA } // namespace ITA
......
...@@ -52,7 +52,7 @@ namespace ITA ...@@ -52,7 +52,7 @@ namespace ITA
//! \brief Constructor for CWorkerThread. //! \brief Constructor for CWorkerThread.
//! \param oConfig the WorkerConfig used to configure the CWorkerThread. //! \param oConfig the WorkerConfig used to configure the CWorkerThread.
//! \param pParent the parent scheduler of the worker. //! \param pParent the parent scheduler of the worker.
CWorkerThread(const WorkerThreadConfig& oConfig, ISchedulerInterface* pParent); CWorkerThread(const WorkerThreadConfig& oConfig);
//! \brief Destructor of CWorkerThread. //! \brief Destructor of CWorkerThread.
/** /**
...@@ -83,7 +83,7 @@ namespace ITA ...@@ -83,7 +83,7 @@ namespace ITA
//! \brief Factory function for CWorkerThread. //! \brief Factory function for CWorkerThread.
//! \param pConfig the WorkerConfig used to configure the CWorkerThread. //! \param pConfig the WorkerConfig used to configure the CWorkerThread.
//! \param pParent the parent scheduler of the worker. //! \param pParent the parent scheduler of the worker.
static std::unique_ptr<IWorkerInterface> CreateWorker(const std::shared_ptr<IWorkerInterface::WorkerConfig>& pConfig, ISchedulerInterface* pParent); static std::unique_ptr<IWorkerInterface> CreateWorker(const std::shared_ptr<IWorkerInterface::WorkerConfig>& pConfig);
//! \brief Return a unique type identifying string. //! \brief Return a unique type identifying string.
//! \return a unique type identifying string. //! \return a unique type identifying string.
......
...@@ -45,9 +45,8 @@ namespace ITA ...@@ -45,9 +45,8 @@ namespace ITA
/// ///
/// \brief Constructor for a IRavenWorkerInterface. /// \brief Constructor for a IRavenWorkerInterface.
/// \param oConfig the WorkerConfig used to configure the IWorkerInterface. /// \param oConfig the WorkerConfig used to configure the IWorkerInterface.
/// \param pParent the parent scheduler of the worker.
/// ///
explicit IRavenWorkerInterface ( const RavenWorkerConfig& oConfig, ISchedulerInterface* pParent ); explicit IRavenWorkerInterface ( const RavenWorkerConfig& oConfig );
/// ///
/// \brief Pure virtual destructor. /// \brief Pure virtual destructor.
......
...@@ -52,9 +52,8 @@ namespace ITA ...@@ -52,9 +52,8 @@ namespace ITA
/// ///
/// \brief Constructor for CWorkerThread. /// \brief Constructor for CWorkerThread.
/// \param oConfig the WorkerConfig used to configure the CWorkerThread. /// \param oConfig the WorkerConfig used to configure the CWorkerThread.
/// \param pParent the parent scheduler of the worker.
/// ///
CWorkerThread ( const WorkerThreadConfig& oConfig, ISchedulerInterface* pParent ); CWorkerThread ( const WorkerThreadConfig& oConfig );
/// ///
/// \brief Destructor of CWorkerThread. /// \brief Destructor of CWorkerThread.
...@@ -87,9 +86,8 @@ namespace ITA ...@@ -87,9 +86,8 @@ namespace ITA
/// ///
/// \brief Factory function for CWorkerThread. /// \brief Factory function for CWorkerThread.
/// \param pConfig the WorkerConfig used to configure the CWorkerThread. /// \param pConfig the WorkerConfig used to configure the CWorkerThread.
/// \param pParent the parent scheduler of the worker.
/// ///
static std::unique_ptr<IWorkerInterface> CreateWorker ( const std::shared_ptr<IWorkerInterface::WorkerConfig>& pConfig, ISchedulerInterface* pParent ); static std::unique_ptr<IWorkerInterface> CreateWorker ( const std::shared_ptr<IWorkerInterface::WorkerConfig>& pConfig );
/// ///
/// \brief Return a unique type identifying string. /// \brief Return a unique type identifying string.
......
...@@ -36,9 +36,8 @@ namespace ITA ...@@ -36,9 +36,8 @@ namespace ITA
/// ///
/// \brief Constructor for IRoomAcousticsWorkerInterface. /// \brief Constructor for IRoomAcousticsWorkerInterface.
/// \param oConfig the config for the IRoomAcousticsWorkerInterface. /// \param oConfig the config for the IRoomAcousticsWorkerInterface.
/// \param pParent the parent scheduler of the worker.
/// ///
IRoomAcousticsWorkerInterface ( const RoomAcousticsWorkerInterfaceConfig& oConfig, ISchedulerInterface* pParent ); IRoomAcousticsWorkerInterface ( const RoomAcousticsWorkerInterfaceConfig& oConfig );
virtual ~IRoomAcousticsWorkerInterface ( ) = 0; virtual ~IRoomAcousticsWorkerInterface ( ) = 0;
......
...@@ -23,6 +23,7 @@ set( DirFiles ...@@ -23,6 +23,7 @@ set( DirFiles
scheduler.h scheduler.h
worker_interface.h worker_interface.h
config_interface.h config_interface.h
factory.h
#_SourceFiles.cmake #_SourceFiles.cmake
) )
......
#ifndef INCLUDE_WATCHER_ITA_SIMULATION_SCHEDULER_FACTORY
#define INCLUDE_WATCHER_ITA_SIMULATION_SCHEDULER_FACTORY
// std includes
#include <memory>
#include <functional>
// API includes
#include <ITA/SimulationScheduler/definitions.h>
// simulation scheduler includes
#include <ITA/SimulationScheduler/update_scene.h>
#include <ITA/SimulationScheduler/config_interface.h>
namespace ITA
{
namespace SimulationScheduler
{
template<class Enum>
struct EnableFactory : public std::false_type
{
};
#define ENABLE_FACTORY(x) template<> struct ITA_SIMULATION_SCHEDULER_API EnableFactory<x> : public std::true_type {};
///
/// \brief Factory class for Worker.
///
/// This class implements an extensible factory for objects.
/// After a type of object is registered with its create function and config, it can be created using this factory.
///
template< class objectT, class objectConfigT>
class CFactory
{
public:
static_assert( EnableFactory<objectConfigT>::value,
"Factory creation is not allowed for this config type; "
"use ENABLE_FACTORY macro." );
///
/// \brief The function signature for a create function.
///
typedef std::function<std::unique_ptr<objectT> ( const std::shared_ptr<objectConfigT>& )> CreateCallback;
///
/// \brief The function signature for a config create function.
///
typedef std::function<std::shared_ptr<objectConfigT> ( )> ConfigCreateCallback;
typedef std::map < std::string, std::pair<CreateCallback, ConfigCreateCallback> > FactoryFunctionMap_t;
///
/// \brief Register a type of object to the factory.
/// \param type name of the object type to be registered.
/// \param createFunction the corresponding create function.
/// \param configCreateFunction the corresponding config create function.
///
static void RegisterObject ( const std::string& type, CreateCallback createFunction, ConfigCreateCallback configCreateFunction )
{
m_mFactoryFunctions [type] = { createFunction, configCreateFunction };
}
///
/// \brief Unregister a type of object from the factory.
/// \param type name of the worker type to be removed.
///
static void UnregisterObject ( const std::string& type )
{
m_mFactoryFunctions.erase ( type );
}
///
/// \brief Factory method.
/// \param pConfig the configuration for the object.
/// \return a pointer to the created object.
///
static std::unique_ptr<objectT> CreateObject ( const std::shared_ptr<objectConfigT>& pConfig )
{
auto it = m_mFactoryFunctions.find ( pConfig->sType );
if ( it != m_mFactoryFunctions.end ( ) )
{
// call the creation callback to construct this derived type
return it->second.first ( pConfig );
}
return nullptr;
}
///
/// \brief Factory method for configs.
/// \param sType the configuration for the object.
/// \return a pointer to the created config.
///
static std::shared_ptr<objectConfigT> CreateConfig ( const std::string& sType )
{
auto it = m_mFactoryFunctions.find ( sType );
if ( it != m_mFactoryFunctions.end ( ) )
{
// call the creation callback to construct this derived type
return it->second.second ( );
}
return nullptr;
}
private:
///
/// \brief Map containing all creation functions and config creation functions.
///
static FactoryFunctionMap_t m_mFactoryFunctions;
};
} // namespace SimulationScheduler
} // namespace ITA
#endif // INCLUDE_WATCHER_ITA_SIMULATION_SCHEDULER_FACTORY
\ No newline at end of file
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
// simulation scheduler includes // simulation scheduler includes
#include <ITA/SimulationScheduler/update_scene.h> #include <ITA/SimulationScheduler/update_scene.h>
#include <ITA/SimulationScheduler/config_interface.h> #include <ITA/SimulationScheduler/config_interface.h>
#include <ITA/SimulationScheduler/factory.h>
namespace ITA namespace ITA
...@@ -43,7 +44,7 @@ namespace ITA ...@@ -43,7 +44,7 @@ namespace ITA
/// ///
/// \brief Base configuration class for worker. /// \brief Base configuration class for worker.
/// ///
/// \note ::sWorkerType is a read only property of the WorkerConfig. /// \note ::sType is a read only property of the WorkerConfig.
/// Due to this the copy constructor and assignment operator are needed. /// Due to this the copy constructor and assignment operator are needed.
/// ///
struct ITA_SIMULATION_SCHEDULER_API WorkerConfig : public IConfig struct ITA_SIMULATION_SCHEDULER_API WorkerConfig : public IConfig
...@@ -56,7 +57,9 @@ namespace ITA ...@@ -56,7 +57,9 @@ namespace ITA
WorkerConfig& operator=( const WorkerConfig& other ); WorkerConfig& operator=( const WorkerConfig& other );
const std::string& sWorkerType; const std::string& sType;
ISchedulerInterface* pParent;
VistaPropertyList Store ( ) const override = 0; VistaPropertyList Store ( ) const override = 0;
...@@ -67,9 +70,9 @@ namespace ITA ...@@ -67,9 +70,9 @@ namespace ITA
/// ///
/// \brief Constructor for IWorkerInterface. /// \brief Constructor for IWorkerInterface.
/// \param pParent the parent scheduler of the worker. /// \param oConfig the config of the worker.
/// ///
IWorkerInterface ( ISchedulerInterface* pParent ); IWorkerInterface ( const WorkerConfig& oConfig );
virtual ~IWorkerInterface ( ) = default; virtual ~IWorkerInterface ( ) = default;
...@@ -108,7 +111,11 @@ namespace ITA ...@@ -108,7 +111,11 @@ namespace ITA
ISchedulerInterface* m_pParentScheduler = nullptr; ISchedulerInterface* m_pParentScheduler = nullptr;
}; };
ENABLE_FACTORY ( IWorkerInterface::WorkerConfig );
typedef CFactory<IWorkerInterface, IWorkerInterface::WorkerConfig> ITA_SIMULATION_SCHEDULER_API CWorkerFactory;
/*
/// ///
/// \brief Factory class for Worker. /// \brief Factory class for Worker.
/// ///
...@@ -163,7 +170,7 @@ namespace ITA ...@@ -163,7 +170,7 @@ namespace ITA
/// \brief Map containing all creation functions. /// \brief Map containing all creation functions.
/// ///
static std::map < std::string, std::pair<CreateCallback, ConfigCreateCallback> > m_mWorkers; static std::map < std::string, std::pair<CreateCallback, ConfigCreateCallback> > m_mWorkers;
}; };*/
} // namespace SimulationScheduler } // namespace SimulationScheduler
} // namespace ITA } // namespace ITA
......
...@@ -21,29 +21,12 @@ namespace ITA ...@@ -21,29 +21,12 @@ namespace ITA
{ {
namespace AudibilityFilter namespace AudibilityFilter
{ {
std::map<std::string, std::pair<CAudibilityFilterFactory::CreateCallback, CAudibilityFilterFactory::ConfigCreateCallback>> IAudibilityFilter::AudibilityFilterConfig::AudibilityFilterConfig ( ) : sType ( m_sFilterType )
CAudibilityFilterFactory::m_mFilters = {
{CRateFilter::GetType ( ),
{ CRateFilter::CreateFilter, std::make_shared<CRateFilter::RateFilterConfig> } },
{CReverberationRadiusFilter::GetType ( ),
{ CReverberationRadiusFilter::CreateFilter, std::make_shared<CReverberationRadiusFilter::ReverberationRadiusFilterConfig> } },
{CRotationFilter::GetType ( ),
{ CRotationFilter::CreateFilter, std::make_shared<CRotationFilter::RotationFilterConfig> } },
{CTranslationFilter::GetType ( ),
{ CTranslationFilter::CreateFilter, std::make_shared<CTranslationFilter::TranslationFilterConfig> } },
{CZoneFilter::GetType ( ),
{ CZoneFilter::CreateFilter, std::make_shared<CZoneFilter::ZoneFilterConfig> } },
{CPerceptiveRotationFilter::GetType ( ),
{ CPerceptiveRotationFilter::CreateFilter, std::make_shared<CPerceptiveRotationFilter::PerceptiveRotationFilterConfig> } }
};
IAudibilityFilter::AudibilityFilterConfig::AudibilityFilterConfig ( ) : sFilterType ( m_sFilterType )
{ {
m_sFilterType = "Unknown"; m_sFilterType = "Unknown";
} }
IAudibilityFilter::AudibilityFilterConfig::AudibilityFilterConfig ( std::string sType ) : sFilterType ( m_sFilterType ) IAudibilityFilter::AudibilityFilterConfig::AudibilityFilterConfig ( std::string sType ) : sType ( m_sFilterType )
{ {
m_sFilterType = sType; m_sFilterType = sType;
} }
...@@ -51,7 +34,7 @@ namespace ITA ...@@ -51,7 +34,7 @@ namespace ITA
IAudibilityFilter::AudibilityFilterConfig::AudibilityFilterConfig ( const AudibilityFilterConfig& other ) : IAudibilityFilter::AudibilityFilterConfig::AudibilityFilterConfig ( const AudibilityFilterConfig& other ) :
IConfig ( other ), IConfig ( other ),
sFilterName ( other.sFilterName ), sFilterName ( other.sFilterName ),
sFilterType ( m_sFilterType ), sType ( m_sFilterType ),
sNextFilter ( other.sNextFilter ), sNextFilter ( other.sNextFilter ),
eUsageMode ( other.eUsageMode ), eUsageMode ( other.eUsageMode ),
bInvertCondition ( other.bInvertCondition ), bInvertCondition ( other.bInvertCondition ),
...@@ -97,7 +80,7 @@ namespace ITA ...@@ -97,7 +80,7 @@ namespace ITA
if ( previousState.GetTimeStamp ( ) > newUpdate.GetTimeStamp ( ) ) if ( previousState.GetTimeStamp ( ) > newUpdate.GetTimeStamp ( ) )
ITA_EXCEPT_INVALID_PARAMETER ( "The previous state happend before the new update" ); ITA_EXCEPT_INVALID_PARAMETER ( "The previous state happend before the new update" );
} }
/*
void CAudibilityFilterFactory::RegisterFilter ( const std::string& type, CreateCallback createFunction, ConfigCreateCallback configCreateFunction ) void CAudibilityFilterFactory::RegisterFilter ( const std::string& type, CreateCallback createFunction, ConfigCreateCallback configCreateFunction )
{ {
m_mFilters [type] = { createFunction, configCreateFunction }; m_mFilters [type] = { createFunction, configCreateFunction };
...@@ -110,7 +93,7 @@ namespace ITA ...@@ -110,7 +93,7 @@ namespace ITA
std::unique_ptr<IAudibilityFilter> CAudibilityFilterFactory::CreateFilter ( const std::shared_ptr<IAudibilityFilter::AudibilityFilterConfig>& pConfig ) std::unique_ptr<IAudibilityFilter> CAudibilityFilterFactory::CreateFilter ( const std::shared_ptr<IAudibilityFilter::AudibilityFilterConfig>& pConfig )
{ {
auto it = m_mFilters.find ( pConfig->sFilterType ); auto it = m_mFilters.find ( pConfig->sType );
if ( it != m_mFilters.end ( ) ) if ( it != m_mFilters.end ( ) )
{ {
// call the creation callback to construct this derived type // call the creation callback to construct this derived type
...@@ -129,7 +112,24 @@ namespace ITA ...@@ -129,7 +112,24 @@ namespace ITA
return it->second.second ( ); return it->second.second ( );
} }
return nullptr; return nullptr;
} }*/
} // namespace AudibilityFilter } // namespace AudibilityFilter
CFactory<AudibilityFilter::IAudibilityFilter, AudibilityFilter::IAudibilityFilter::AudibilityFilterConfig>::FactoryFunctionMap_t
CFactory<AudibilityFilter::IAudibilityFilter, AudibilityFilter::IAudibilityFilter::AudibilityFilterConfig>::m_mFactoryFunctions = {
{AudibilityFilter::CRateFilter::GetType ( ),
{ AudibilityFilter::CRateFilter::CreateFilter, std::make_shared<AudibilityFilter::CRateFilter::RateFilterConfig> } },
{AudibilityFilter::CReverberationRadiusFilter::GetType ( ),
{ AudibilityFilter::CReverberationRadiusFilter::CreateFilter, std::make_shared<AudibilityFilter::CReverberationRadiusFilter::ReverberationRadiusFilterConfig> } },
{AudibilityFilter::CRotationFilter::GetType ( ),
{ AudibilityFilter::CRotationFilter::CreateFilter, std::make_shared<AudibilityFilter::CRotationFilter::RotationFilterConfig> } },
{AudibilityFilter::CTranslationFilter::GetType ( ),
{ AudibilityFilter::CTranslationFilter::CreateFilter, std::make_shared<AudibilityFilter::CTranslationFilter::TranslationFilterConfig> } },
{AudibilityFilter::CZoneFilter::GetType ( ),
{ AudibilityFilter::CZoneFilter::CreateFilter, std::make_shared<AudibilityFilter::CZoneFilter::ZoneFilterConfig> } },
{AudibilityFilter::CPerceptiveRotationFilter::GetType ( ),
{ AudibilityFilter::CPerceptiveRotationFilter::CreateFilter, std::make_shared<AudibilityFilter::CPerceptiveRotationFilter::PerceptiveRotationFilterConfig> } }
};
} // namespace SimulationScheduler } // namespace SimulationScheduler
} // namespace ITA } // namespace ITA
...@@ -129,7 +129,7 @@ namespace ITA ...@@ -129,7 +129,7 @@ namespace ITA
if ( m_mAudibilityFilters.find ( filterConfig->sFilterName ) != m_mAudibilityFilters.end ( ) ) if ( m_mAudibilityFilters.find ( filterConfig->sFilterName ) != m_mAudibilityFilters.end ( ) )
ITA_EXCEPT_INVALID_PARAMETER ( "Filter name already exist in network" ); ITA_EXCEPT_INVALID_PARAMETER ( "Filter name already exist in network" );
m_mAudibilityFilters.insert ( { filterConfig->sFilterName , CAudibilityFilterFactory::CreateFilter ( filterConfig ) } ); m_mAudibilityFilters.insert ( { filterConfig->sFilterName , CAudibilityFilterFactory::CreateObject ( filterConfig ) } );
} }
} }
......
...@@ -52,8 +52,8 @@ namespace ITA ...@@ -52,8 +52,8 @@ namespace ITA
oProperties.GetValue(SIMULATOR_TYPE_KEY, m_sSimulatorType); oProperties.GetValue(SIMULATOR_TYPE_KEY, m_sSimulatorType);
} }
CWorkerThread::CWorkerThread(const WorkerThreadConfig& oConfig, ISchedulerInterface* pParent) : CWorkerThread::CWorkerThread(const WorkerThreadConfig& oConfig) :
IWorkerInterface(pParent), m_evTriggerLoop(VistaThreadEvent::NON_WAITABLE_EVENT) IWorkerInterface(oConfig), m_evTriggerLoop(VistaThreadEvent::NON_WAITABLE_EVENT)
{ {
//oConfig; //oConfig;
//m_oSimulator = std::make_unique<CSimulator> ( m_eFieldOfDuty, oConfig.sRavenProjectFilePath ); //m_oSimulator = std::make_unique<CSimulator> ( m_eFieldOfDuty, oConfig.sRavenProjectFilePath );
...@@ -123,9 +123,9 @@ namespace ITA ...@@ -123,9 +123,9 @@ namespace ITA
} }
std::unique_ptr<IWorkerInterface> CWorkerThread::CreateWorker( std::unique_ptr<IWorkerInterface> CWorkerThread::CreateWorker(
const std::shared_ptr<IWorkerInterface::WorkerConfig>& pConfig, ISchedulerInterface* pParent) const std::shared_ptr<IWorkerInterface::WorkerConfig>& pConfig)
{ {
return std::make_unique<CWorkerThread>(dynamic_cast<const WorkerThreadConfig&>(*pConfig), pParent); return std::make_unique<CWorkerThread>(dynamic_cast<const WorkerThreadConfig&>(*pConfig));
} }
//void CWorkerThread::SetSimulator ( std::unique_ptr<ISimulatorInterface> pSimulator ) //void CWorkerThread::SetSimulator ( std::unique_ptr<ISimulatorInterface> pSimulator )
......
...@@ -36,9 +36,8 @@ namespace ITA ...@@ -36,9 +36,8 @@ namespace ITA
RoomAcousticsWorkerInterfaceConfig::Load ( oProperties ); RoomAcousticsWorkerInterfaceConfig::Load ( oProperties );
} }
IRavenWorkerInterface::IRavenWorkerInterface ( const RavenWorkerConfig& oConfig, IRavenWorkerInterface::IRavenWorkerInterface ( const RavenWorkerConfig& oConfig ) :
ISchedulerInterface* pParent ) : IRoomAcousticsWorkerInterface ( oConfig )
IRoomAcousticsWorkerInterface ( oConfig, pParent )
{ } { }
IRavenWorkerInterface::~IRavenWorkerInterface ( ) IRavenWorkerInterface::~IRavenWorkerInterface ( )
......
...@@ -46,8 +46,8 @@ namespace ITA ...@@ -46,8 +46,8 @@ namespace ITA
oProperties.GetValue ( ravenProjectFilePathKey, sRavenProjectFilePath ); oProperties.GetValue ( ravenProjectFilePathKey, sRavenProjectFilePath );
} }
CWorkerThread::CWorkerThread ( const WorkerThreadConfig& oConfig, ISchedulerInterface* pParent ) : CWorkerThread::CWorkerThread ( const WorkerThreadConfig& oConfig ) :
IRavenWorkerInterface ( oConfig, pParent ), m_evTriggerLoop ( VistaThreadEvent::NON_WAITABLE_EVENT ) IRavenWorkerInterface ( oConfig ), m_evTriggerLoop ( VistaThreadEvent::NON_WAITABLE_EVENT )
{ {
m_pSimulator = std::make_unique<CSimulator> ( m_eFieldOfDuty, oConfig.sRavenProjectFilePath ); m_pSimulator = std::make_unique<CSimulator> ( m_eFieldOfDuty, oConfig.sRavenProjectFilePath );
...@@ -128,9 +128,9 @@ namespace ITA ...@@ -128,9 +128,9 @@ namespace ITA
} }
std::unique_ptr<IWorkerInterface> CWorkerThread::CreateWorker ( std::unique_ptr<IWorkerInterface> CWorkerThread::CreateWorker (
const std::shared_ptr<IWorkerInterface::WorkerConfig>& pConfig, ISchedulerInterface* pParent ) const std::shared_ptr<IWorkerInterface::WorkerConfig>& pConfig )
{ {
return std::make_unique<CWorkerThread> ( dynamic_cast< const WorkerThreadConfig& >( *pConfig ), pParent ); return std::make_unique<CWorkerThread> ( dynamic_cast< const WorkerThreadConfig& >( *pConfig ) );