VR-Engage  2.2
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 Sets the role to script list mapping
85 //! \param map The mapping of roles to allowed script lists
86 //!
87 //! Sets the mapping between roles and lists of scripts that are allowed to be executed
88 //! by entities with those roles while they are engaged in tasks.
90
91 //! \brief Gets the role to script list mapping
92 //! \return Reference to the mapping of roles to allowed script lists
93 //!
94 //! Returns the mapping between roles and lists of scripts that are allowed to be executed
95 //! by entities with those roles while they are engaged in tasks.
97
98 //! \brief Gets the reader/writer type identifier
99 //! \return String identifying the reader/writer type
100 //!
101 //! Returns the type string used for reader/writer registration and lookup.
102 //! Overrides the base class implementation.
103 virtual const char* readerWriterType() const override;
104
105 //! \brief Gets the XML type string used when archiving to an XML stream
106 //! \return String identifying the XML type
107 //!
108 //! Returns the type string used when archiving this descriptor to an XML stream.
109 static const char* theXmlType();
110
111 //! \brief Gets the XML type for this instance
112 //! \return String identifying the XML type
113 //!
114 //! Returns the type string used when archiving this descriptor to an XML stream.
115 //! Overrides the base class implementation.
116 virtual const char* xmlType() const override { return theXmlType(); }
117
118 //! \brief Factory function to create a new instance of this descriptor
119 //! \return Pointer to a newly created descriptor
120 //!
121 //! Static factory function used by the descriptor creation system to instantiate
122 //! new instances of this descriptor type.
123 static DtComponentDescriptor* creator();
124
125protected:
126 //! \brief Mapping of roles to allowed reactive task scripts
127 //!
128 //! Stores the mapping between roles and lists of scripts that are allowed to be executed
129 //! by entities with those roles while they are engaged in tasks. This controls which
130 //! reactive behavior scripts can run based on entity role assignments.
132};
133
134} // namespace makVre
static DtComponentDescriptor * creator()
Factory function to create a new instance 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:131
virtual const char * xmlType() const override
Gets the XML type for this instance.
Definition vreScriptReactiveTaskControllerDescriptor.h:116
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.
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
Include export definitions for this library.
Definition glsVreMessageUtil.h:49
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