raven_worker_interface.h 2.89 KB
Newer Older
1
2
3
#ifndef INCLUDE_WATCHER_ITA_SIMULATION_SCHEDULER_ROOM_ACOUSTICS_RAVEN_RAVEN_WORKER_INTERFACE
#define INCLUDE_WATCHER_ITA_SIMULATION_SCHEDULER_ROOM_ACOUSTICS_RAVEN_RAVEN_WORKER_INTERFACE

4
5
#ifdef WITH_RAVEN

6
7
8
9
// API includes
#include <ITA/simulation_scheduler/definitions.h>

// simulation scheduler includes
10
11
#include <ITA/simulation_scheduler/room_acoustics/room_acoustics_worker_interface.h>
#include <ITA/simulation_scheduler/room_acoustics/rir_simulation_result.h>
12
13
14

namespace ITA
{
15
	namespace SimulationScheduler
16
	{
17
		namespace RoomAcoustics
18
		{
19
			namespace Raven
20
21
22
23
24
25
26
			{
				class CSimulationTask;
				class CRavenConfig;
				class CRavenSimulationResult;
				class CSimulationTask;

				///
Pascal Palenda's avatar
Pascal Palenda committed
27
				/// \brief Interface for room acoustics worker that use raven to simulate updates.
28
29
				/// \todo Add functions to change the config.
				/// 
30
				class ITA_SIMULATION_SCHEDULER_API IRavenWorkerInterface : public IRoomAcousticsWorkerInterface
31
32
				{
				public:
Pascal Palenda's avatar
Pascal Palenda committed
33
34
35
					///
					/// \brief Configuration class for Raven worker.
					/// 
36
					struct ITA_SIMULATION_SCHEDULER_API RavenWorkerConfig : public RoomAcousticsWorkerInterfaceConfig
Pascal Palenda's avatar
Pascal Palenda committed
37
					{
38
						explicit RavenWorkerConfig ( std::string sType );
Pascal Palenda's avatar
Pascal Palenda committed
39

40
						VistaPropertyList Store ( ) const override = 0;
Pascal Palenda's avatar
Pascal Palenda committed
41

42
						void Load ( const VistaPropertyList& oProperties ) override = 0;
Pascal Palenda's avatar
Pascal Palenda committed
43
44
					};

45
46
47
48
49
50
51
					IRavenWorkerInterface ( ) = delete;

					///
					/// \brief Constructor for a IRavenWorkerInterface.
					/// \param oConfig the WorkerConfig used to configure the IWorkerInterface.
					/// \param pParent the parent scheduler of the worker.
					/// 
52
					explicit IRavenWorkerInterface ( const RavenWorkerConfig& oConfig, ISchedulerInterface* pParent );
53
54
55
56
57
58
59
60
61
62
63
64
65

					///
					/// \brief Pure virtual destructor.
					/// 
					virtual ~IRavenWorkerInterface ( ) = 0;

				protected:
					///
					/// \brief Converts a CUpdateScene into a CSimulationTask.
					/// \param pUpdate the update to be converted.
					/// \return a suitable CSimulationTask containing the information of the update.
					/// \todo Setting of the CRavenConfig: Why only set certain members.
					/// 
66
					std::unique_ptr<CSimulationTask> CreateTaskFromUpdate ( std::unique_ptr<CUpdateScene> pUpdate ) const;
67
68

					///
69
					/// \brief Converts between the CRavenSimulationResult and CRIRSimulationResult.
70
71
					/// \param pResult the CRavenSimulationResult to be converted.
					/// \param pTask the task used to compute the result.
72
					/// \return the according CRIRSimulationResult.
73
74
					/// \todo Change the API of the simulator so that this is not necessary anymore.
					/// 
75
					static std::unique_ptr<CRIRSimulationResult> ConvertSimulationResult ( std::unique_ptr<CRavenSimulationResult> pResult, CSimulationTask* pTask );
76
				};
77
78
79
			} // namespace Raven
		} // namespace RoomAcoustics
	} // namespace SimulationScheduler
80
81
} // namespace ITA

82
83
#endif

84
#endif // INCLUDE_WATCHER_ITA_SIMULATION_SCHEDULER_ROOM_ACOUSTICS_RAVEN_RAVEN_WORKER_INTERFACE