VR-Engage  2.2
Loading...
Searching...
No Matches
vreTaskSetBuilder.h
Go to the documentation of this file.
1/*******************************************************************************
2** Copyright (c) 2025 MAK Technologies
3** All rights reserved.
4*******************************************************************************/
5
6//! \file vreTaskSetBuilder.h
7//! \ingroup vreVrfobjcore
8//! \brief Task set builder class for VREngage
9//!
10//! This file defines the DtVreTaskSetBuilder class, which provides functionality for
11//! dynamically building tasks and sets based on parameters provided in a map. It extends
12//! the base task set builder with VREngage-specific functionality for creating simulation
13//! tasks and data requests.
14
15#pragma once
16
18
19#include <vrflua/taskSetBuilder.h>
20
21//! \brief Class for dynamically building tasks and sets in VREngage
22//!
23//! This class extends the base task set builder to provide VREngage-specific
24//! functionality for dynamically creating simulation tasks and data requests.
25//! It builds tasks and sets based on parameters provided in a map of DtReaderWriters,
26//! allowing for flexible task creation in Lua scripts and other contexts.
27class VREVRFOBJCORE_DLL DtVreTaskSetBuilder : public DtTaskSetBuilder
28{
29private:
30 //! \brief Default constructor (not implemented)
31 //!
32 //! Default constructor is private and not implemented to prevent
33 //! creation of instances without a scripted task manager.
35
36 //! \brief Copy constructor (not implemented)
37 //! \param orig The source builder to copy from
38 //!
39 //! Copy constructor is private and not implemented to prevent copying.
41
42 //! \brief Assignment operator (not implemented)
43 //! \param orig The source builder to copy from
44 //! \return Reference to this builder after assignment
45 //!
46 //! Assignment operator is private and not implemented to prevent assignment.
48
49public:
50 //! \brief Constructor with scripted task manager
51 //! \param scriptedTaskManager Pointer to the scripted task manager
52 //!
53 //! Creates a new task set builder associated with the specified scripted task manager.
54 //! The scripted task manager provides access to task and set creation facilities.
55 DtVreTaskSetBuilder(const DtScriptedTaskManager* scriptedTaskManager);
56
57 //! \brief Type definition for parameter map
58 //!
59 //! Maps parameter names to their corresponding DtReaderWriter values.
60 //! This is used to pass parameters to task and set creation methods.
61 using ParamMap = std::map<DtString, DtReaderWriter*>;
62
63 //! \brief Builds a simulation task
64 //! \param taskType The type of task to build
65 //! \param paremeters Map of parameter names to their values
66 //! \return Pointer to the newly created task, or nullptr if creation failed
67 //!
68 //! Creates a new simulation task of the specified type, using the parameters
69 //! provided in the parameter map. The returned task is owned by the caller
70 //! and must be deleted when no longer needed.
71 virtual DtSimTask* buildTask(const DtSimTaskMessageType& taskType, const ParamMap& paremeters);
72
73 //! \brief Builds a set data request
74 //! \param setType The type of set to build
75 //! \param paremeters Map of parameter names to their values
76 //! \return Pointer to the newly created set data request, or nullptr if creation failed
77 //!
78 //! Creates a new set data request of the specified type, using the parameters
79 //! provided in the parameter map. The returned request is owned by the caller
80 //! and must be deleted when no longer needed.
81 virtual DtSetDataRequest* buildSet(const DtSetMessageType& setType, const ParamMap& paremeters);
82
83protected:
84 //! \brief Fills a reader/writer parameter from the parameter map
85 //! \param rw Pointer to the reader/writer to fill
86 //! \param parameters Map of available parameters
87 //! \param usedParam Output parameter that will receive the name of the parameter used
88 //! \return True if the parameter was successfully filled, false otherwise
89 //!
90 //! Attempts to fill the specified reader/writer from the parameter map. If successful,
91 //! usedParam will be set to the name of the parameter that was used to fill the
92 //! reader/writer. This method is used internally by buildTask and buildSet to
93 //! populate task and set parameters from the provided parameter map.
94 virtual bool fillInParameter(DtReaderWriter* rw, const ParamMap& parameters, DtString& usedParam);
95};
DtVreTaskSetBuilder(const DtScriptedTaskManager *scriptedTaskManager)
Constructor with scripted task manager.
DtVreTaskSetBuilder()
Default constructor (not implemented)
virtual bool fillInParameter(DtReaderWriter *rw, const ParamMap &parameters, DtString &usedParam)
Fills a reader/writer parameter from the parameter map.
virtual DtSetDataRequest * buildSet(const DtSetMessageType &setType, const ParamMap &paremeters)
Builds a set data request.
virtual DtSimTask * buildTask(const DtSimTaskMessageType &taskType, const ParamMap &paremeters)
Builds a simulation task.
std::map< DtString, DtReaderWriter * > ParamMap
Type definition for parameter map.
Definition vreTaskSetBuilder.h:61
DtVreTaskSetBuilder & operator=(const DtVreTaskSetBuilder &orig)
Assignment operator (not implemented)
DtVreTaskSetBuilder(const DtVreTaskSetBuilder &orig)
Copy constructor (not implemented)
Export macros for the VREngage Object Core library.
#define VREVRFOBJCORE_DLL
Platform-specific DLL export/import declaration.
Definition export.h:27