VR-Engage  2.2
Loading...
Searching...
No Matches
attributeProviderComponentDescriptor.h
Go to the documentation of this file.
1/*******************************************************************************
2** Copyright (c) 2025 MAK Technologies
3** All rights reserved.
4*******************************************************************************/
5
6//! \file attributeProviderComponentDescriptor.h
7//! \ingroup vreVrfobjparam
8//! \brief Attribute provider component descriptor for VREngage
9//!
10//! This file defines the DtAttributeProviderComponentDescriptor class, which configures
11//! the attribute provider component in VREngage. This component allows entities to
12//! provide custom key-value attributes to the simulation system, enabling dynamic
13//! property assignment and retrieval.
14
15#pragma once
16
17
18#include <vrfobjparam/componentDescriptor.h>
19#include <vrfutil/rwTemplatedMap.h>
20
22
23class DtReaderWriterRegistry;
24
25
26namespace makVre
27{
28//! \brief Type identifier string for the attribute provider component descriptor
29const char DtAttributeProviderComponentDescriptorType[] = "attribute-provider-component-descriptor";
30
31//! \brief Key-value map type for storing attribute pairs
32//!
33//! This typedef defines a map of string keys to string values, used for
34//! storing and retrieving custom attributes in the simulation system.
35using DtRwKeyValueMap = DtRwTemplatedMapPtr<DtRwString, DtRwString>;
36
37//! \brief Attribute provider component descriptor for VREngage
38//!
39//! This class defines a descriptor for the attribute provider component,
40//! which allows entities to provide custom key-value attributes to the
41//! simulation system. These attributes can be used for various purposes,
42//! including entity classification, capability definition, and property retrieval.
44{
45public:
46 //! \brief Constructor with component name
47 //! \param componentName The name of this component
48 //! \param parentRegistry Parent registry for reader/writer functionality (optional)
49 //!
50 //! Creates a new attribute provider component descriptor with the specified name.
51 DtAttributeProviderComponentDescriptor(const DtString& componentName, DtReaderWriterRegistry* parentRegistry = 0);
52
53 //! \brief Copy constructor
54 //! \param orig The source descriptor to copy from
55 //! \param parentRegistry Parent registry for reader/writer functionality (optional)
56 //!
57 //! Creates a new attribute provider component descriptor as a copy of the provided original.
59 const DtAttributeProviderComponentDescriptor& orig, DtReaderWriterRegistry* parentRegistry = 0);
60
61 //! \brief Assignment operator
62 //! \param orig The source descriptor to copy from
63 //! \return Reference to this descriptor after assignment
64 //!
65 //! Assigns the contents of the provided descriptor to this one.
67
68 //! \brief Virtual destructor
69 //!
70 //! Cleans up resources used by the descriptor.
72
73 //! \brief Gets the type identifier for this descriptor
74 //! \return String identifying this descriptor type
75 //!
76 //! Returns a unique type identifier string for this descriptor type.
77 //! Will return makVre::DtAttributeProviderComponentDescriptorType.
78 virtual DtString type() const override;
79
80 //! \brief Creates a clone of this descriptor
81 //! \param parentRegistry Parent registry for reader/writer functionality (optional)
82 //! \return Pointer to a new descriptor that is a clone of this one
83 //!
84 //! Creates a new attribute provider component descriptor as a deep copy of this one.
85 virtual DtComponentDescriptor* clone(DtReaderWriterRegistry* parentRegistry = 0) const override;
86
87 //! \brief Gets the attributes map
88 //! \return Reference to the key-value map of attributes
89 //!
90 //! Returns the map of custom attributes defined for this component.
91 virtual DtRwKeyValueMap attributes() const;
92
93 //! \brief Factory function to create a new instance of this descriptor
94 //! \return Pointer to a newly created descriptor
95 //!
96 //! Static factory function used by the descriptor creation system to instantiate
97 //! new instances of this descriptor type.
98 static DtComponentDescriptor* creator();
99
100protected:
101 //! \brief Default constructor (not implemented)
102 //!
103 //! Default constructor is protected and not implemented to prevent
104 //! creation of instances without proper initialization.
106
107protected:
108 //! \name Configuration Parameters
109 //! These parameters are available for setting in the OPD files.
110 //! The values are copied to the PSR so that other components
111 //! can access them during simulation.
112 //! @{
113
114 //! \brief Map of custom attributes
115 //!
116 //! Stores the key-value pairs of custom attributes to be provided by this component.
117 //! These attributes can be queried at runtime and used for various purposes in the
118 //! simulation system.
120
121 //! @}
122};
123} // namespace makVre
DtAttributeProviderComponentDescriptor(const DtAttributeProviderComponentDescriptor &orig, DtReaderWriterRegistry *parentRegistry=0)
Copy constructor.
static DtComponentDescriptor * creator()
Factory function to create a new instance of this descriptor.
DtAttributeProviderComponentDescriptor()
Default constructor (not implemented)
DtRwKeyValueMap myAttributes
Map of custom attributes.
Definition attributeProviderComponentDescriptor.h:119
virtual DtString type() const override
Gets the type identifier for this descriptor.
virtual ~DtAttributeProviderComponentDescriptor() override
Virtual destructor.
DtAttributeProviderComponentDescriptor & operator=(const DtAttributeProviderComponentDescriptor &orig)
Assignment operator.
DtAttributeProviderComponentDescriptor(const DtString &componentName, DtReaderWriterRegistry *parentRegistry=0)
Constructor with component name.
virtual DtComponentDescriptor * clone(DtReaderWriterRegistry *parentRegistry=0) const override
Creates a clone of this descriptor.
virtual DtRwKeyValueMap attributes() const
Gets the attributes map.
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, DtRwString > DtRwKeyValueMap
Key-value map type for storing attribute pairs.
Definition attributeProviderComponentDescriptor.h:35
const char DtAttributeProviderComponentDescriptorType[]
Type identifier string for the attribute provider component descriptor.
Definition attributeProviderComponentDescriptor.h:29