VR-Engage  2.3
Loading...
Searching...
No Matches
vreScriptReactiveTaskControllerDescriptor.h
Go to the documentation of this file.
1/*******************************************************************************
2** Copyright (c) 2025 MAK Technologies
3** All rights reserved.
4*******************************************************************************/
5
6//! \file vreScriptReactiveTaskControllerDescriptor.h
7//! \ingroup vreVrfobjparam
8//! \brief Script reactive task controller descriptor for VREngage
9//!
10//! This file defines the DtVreScriptReactiveTaskControllerDescriptor class, which configures
11//! script reactive task controller components in VREngage. It maintains a mapping between
12//! roles and allowed reactive task script lists, controlling which scripts can be executed
13//! based on entity roles.
14
15#pragma once
16
18
19#include <vrfutil/rwNLengthStringVector.h>
20#include <vrfutil/rwTemplatedMap.h>
21#include <readerWriter/rwString.h>
22#include <vrfobjparam/componentDescriptor.h>
23
24namespace makVre
25{
26//! \brief Type identifier string for the script reactive task controller descriptor
27const char DtVreScriptReactiveTaskControllerDescriptorType[] = "vre-script-reactive-task-controller-descriptor";
28
29//! \brief Type definition for a read/write map of roles to script lists
30using DtRwRoleToScriptListMap = DtRwTemplatedMapPtr<DtRwString, DtRwNLengthStringVector>;
31
32//! \brief Type definition for a standard map of roles to script lists
33using DtRoleToScriptListMap = std::map<DtRwString, DtRwNLengthStringVector>;
34
35//! \brief Script reactive task controller descriptor for VREngage
36//!
37//! This class defines a descriptor for script reactive task controller components in VREngage.
38//! It maintains a mapping between roles and allowed reactive task script lists, controlling
39//! which scripts can be executed based on entity roles. This allows for role-specific behavior
40//! scripts to be assigned to entities during engagement scenarios.
42{
43public:
44 //! \brief Default constructor (deleted)
45 //!
46 //! Default constructor is explicitly deleted to prevent
47 //! creation of instances without proper initialization.
49
50 //! \brief Constructor with component name
51 //! \param name The name of this component
52 //! \param parentRegistry Parent registry for reader/writer functionality (optional)
53 //!
54 //! Creates a new script reactive task controller descriptor with the specified name.
55 DtVreScriptReactiveTaskControllerDescriptor(const DtString& name, DtReaderWriterRegistry* parentRegistry = 0);
56
57 //! \brief Constructor with component name as symbol string
58 //! \param name The name of this component as a symbol string
59 //! \param parentRegistry Parent registry for reader/writer functionality (optional)
60 //!
61 //! Creates a new script reactive task controller descriptor with the specified name.
62 DtVreScriptReactiveTaskControllerDescriptor(const DtSymbolString& name, DtReaderWriterRegistry* parentRegistry = 0);
63
64 //! \brief Copy constructor
65 //! \param orig The source descriptor to copy from
66 //! \param parentRegistry Parent registry for reader/writer functionality (optional)
67 //!
68 //! Creates a new script reactive task controller descriptor as a copy of the provided original.
70 const DtVreScriptReactiveTaskControllerDescriptor& orig, DtReaderWriterRegistry* parentRegistry = 0);
71
72 //! \brief Assignment operator
73 //! \param orig The source descriptor to copy from
74 //! \return Reference to this descriptor after assignment
75 //!
76 //! Assigns the contents of the provided descriptor to this one.
78
79 //! \brief Virtual destructor
80 //!
81 //! Cleans up resources used by the descriptor.
83
84 //! \brief Creates a copy of this descriptor
85 //! \param parentRegistry Parent registry for reader/writer functionality (optional)
86 //! \return A copy of this descriptor
87 virtual DtComponentDescriptor* clone(DtReaderWriterRegistry* parentRegistry = 0) const override;
88
89 //! \brief Sets the role to script list mapping
90 //! \param map The mapping of roles to allowed script lists
91 //!
92 //! Sets the mapping between roles and lists of scripts that are allowed to be executed
93 //! by entities with those roles while they are engaged in tasks.
95
96 //! \brief Gets the role to script list mapping
97 //! \return Reference to the mapping of roles to allowed script lists
98 //!
99 //! Returns the mapping between roles and lists of scripts that are allowed to be executed
100 //! by entities with those roles while they are engaged in tasks.
102
103 //! \brief Gets the component descriptor type identifier
104 //! \return String identifying this descriptor type
105 virtual DtString type() const override;
106
107 //! \brief Gets the reader/writer type identifier
108 //! \return String identifying the reader/writer type
109 //!
110 //! Returns the type string used for reader/writer registration and lookup.
111 //! Overrides the base class implementation.
112 virtual const char* readerWriterType() const override;
113
114 //! \brief Gets the XML type string used when archiving to an XML stream
115 //! \return String identifying the XML type
116 //!
117 //! Returns the type string used when archiving this descriptor to an XML stream.
118 static const char* theXmlType();
119
120 //! \brief Gets the XML type for this instance
121 //! \return String identifying the XML type
122 //!
123 //! Returns the type string used when archiving this descriptor to an XML stream.
124 //! Overrides the base class implementation.
125 virtual const char* xmlType() const override { return theXmlType(); }
126
127 //! \brief Factory function to create a new instance of this descriptor
128 //! \return Pointer to a newly created descriptor
129 //!
130 //! Static factory function used by the descriptor creation system to instantiate
131 //! new instances of this descriptor type.
132 static DtComponentDescriptor* creator();
133
134protected:
135 //! \brief Mapping of roles to allowed reactive task scripts
136 //!
137 //! Stores the mapping between roles and lists of scripts that are allowed to be executed
138 //! by entities with those roles while they are engaged in tasks. This controls which
139 //! reactive behavior scripts can run based on entity role assignments.
141};
142
143} // namespace makVre
static DtComponentDescriptor * creator()
Factory function to create a new instance of this descriptor.
virtual DtComponentDescriptor * clone(DtReaderWriterRegistry *parentRegistry=0) const override
Creates a copy of this descriptor.
virtual const char * readerWriterType() const override
Gets the reader/writer type identifier.
DtVreScriptReactiveTaskControllerDescriptor(const DtString &name, DtReaderWriterRegistry *parentRegistry=0)
Constructor with component name.
DtRwRoleToScriptListMap myAllowedReactiveTasksWhileEngaged
Mapping of roles to allowed reactive task scripts.
Definition vreScriptReactiveTaskControllerDescriptor.h:140
virtual const char * xmlType() const override
Gets the XML type for this instance.
Definition vreScriptReactiveTaskControllerDescriptor.h:125
DtVreScriptReactiveTaskControllerDescriptor & operator=(const DtVreScriptReactiveTaskControllerDescriptor &orig)
Assignment operator.
DtVreScriptReactiveTaskControllerDescriptor(const DtSymbolString &name, DtReaderWriterRegistry *parentRegistry=0)
Constructor with component name as symbol string.
virtual ~DtVreScriptReactiveTaskControllerDescriptor() override
Virtual destructor.
static const char * theXmlType()
Gets the XML type string used when archiving to an XML stream.
virtual const DtRoleToScriptListMap & roleToScriptListMap() const
Gets the role to script list mapping.
virtual void setRoleToScriptListMap(const DtRoleToScriptListMap &map)
Sets the role to script list mapping.
virtual DtString type() const override
Gets the component descriptor type identifier.
DtVreScriptReactiveTaskControllerDescriptor()=delete
Default constructor (deleted)
DtVreScriptReactiveTaskControllerDescriptor(const DtVreScriptReactiveTaskControllerDescriptor &orig, DtReaderWriterRegistry *parentRegistry=0)
Copy constructor.
Export macros for the VREngage Object Parameter library.
#define VREVRFOBJPARAM_DLL
Platform-specific DLL export/import declaration.
Definition export.h:27
!
Definition glsVreMessageUtil.h:50
DtRwTemplatedMapPtr< DtRwString, DtRwNLengthStringVector > DtRwRoleToScriptListMap
Type definition for a read/write map of roles to script lists.
Definition vreScriptReactiveTaskControllerDescriptor.h:30
std::map< DtRwString, DtRwNLengthStringVector > DtRoleToScriptListMap
Type definition for a standard map of roles to script lists.
Definition vreScriptReactiveTaskControllerDescriptor.h:33
const char DtVreScriptReactiveTaskControllerDescriptorType[]
Type identifier string for the script reactive task controller descriptor.
Definition vreScriptReactiveTaskControllerDescriptor.h:27