|
VR-Engage
2.2
|
DtExtendedStateConnector manages access to extended state properties of entities in the simulation. It provides mechanisms to request specific property values, monitor entity states, and convert between different data types. The connector supports bool, int, float, string, and more complex types like ammo clip maps.
#include <extendedStateConnector.h>
Public Member Functions | |
| DtExtendedStateConnector () | |
| virtual | ~DtExtendedStateConnector () override |
| virtual void | install (DtPlayerStationApp *app, makVrv::DT_PROTOCOL_NAMESPACE::DtVrlinkConnection *connection) override |
| virtual void | tick () override |
| virtual void | shutdown () override |
Public Member Functions inherited from makVre::DT_PROTOCOL_NAMESPACE::DtSimEventConnector | |
| DtSimEventConnector () | |
| virtual | ~DtSimEventConnector () override |
Public Member Functions inherited from makVre::DtConnector | |
| DtConnector () | |
| virtual | ~DtConnector () |
| virtual DtConnectorType | type () |
| virtual std::string | name () |
Protected Member Functions | |
| virtual DtVreMessageResult | handleExtendedRequest (DtVreMessage *msg) |
| virtual DtVreMessageResult | handleExtendedInit (DtVreMessage *msg) |
| virtual DtReflectedExtEntity * | findEntity (DtEntityIdentifier entityId) |
| template<typename ValueType, typename MessageType> | |
| void | sendAttributeMessage (const std::string &name, ValueType value, const DtEntityIdentifier &entityId) |
| template<typename RwType, typename ValueType, typename MessageType> | |
| bool | sendStatePropertyMessage (DtReflectedExtEntity *entity, const std::string &name) |
| virtual void | sendExtendedDataMessage (DtReflectedExtEntity *entity, const std::string &name, const std::string &type) |
| virtual bool | sendStatePropertyMessage (DtReflectedExtEntity *entity, const std::string &name, const std::string &type) |
| void | logMissingStateProperty (const std::string &name, const std::string &type) |
Protected Attributes | |
| std::map< std::string, std::string > | myNameTypeMap |
| std::map< std::string, std::string > | myPropertyTypeMap |
| DtEntityIdentifier | myEntityId |
| DtGlobalObjectDesignator | myGlobalId |
| DtReflectedExtEntityList * | myRel |
| std::set< std::string > | myMissingStateProperties |
Protected Attributes inherited from makVre::DT_PROTOCOL_NAMESPACE::DtSimEventConnector | |
| DtPlayerStationApp * | myApp |
| makVrv::DT_PROTOCOL_NAMESPACE::DtVrlinkConnection * | myConnection |
Protected Attributes inherited from makVre::DtConnector | |
| std::string | myName |
| DtConnectorType | myType |
Additional Inherited Members | |
Public Types inherited from makVre::DtConnector | |
| enum | DtConnectorType { DIS , HLA13 , HLA1516 , HLA1516E , HLA4 } |
Static Public Member Functions inherited from makVre::DtConnector | |
| static std::string | extension (DtConnectorType type) |
| makVre::DtExtendedStateConnector::DtExtendedStateConnector | ( | ) |
Default constructor.
Initializes member variables with default values
|
overridevirtual |
Virtual destructor.
|
overridevirtual |
Installs the extended state connector with the application and connection.
| app | Pointer to the player station application |
| connection | Pointer to the protocol-specific VR-Link connection |
Registers message handlers for extended state requests and initialization, and retrieves the reflected extended entity list
Reimplemented from makVre::DT_PROTOCOL_NAMESPACE::DtSimEventConnector.
|
overridevirtual |
Performs periodic processing of entity state updates.
For monitored entities, checks and sends updates for registered state properties
Reimplemented from makVre::DT_PROTOCOL_NAMESPACE::DtSimEventConnector.
|
overridevirtual |
Shuts down the extended state connector.
Removes message handlers for extended state requests and initialization
Reimplemented from makVre::DT_PROTOCOL_NAMESPACE::DtSimEventConnector.
|
protectedvirtual |
Handles requests for extended state properties.
| msg | Pointer to the extended state request message |
Processes ExtendedStateRequestMessage by finding the requested entity and sending the requested state property or extended data
|
protectedvirtual |
Handles initialization of extended state monitoring.
| msg | Pointer to the extended state monitor initialization message |
Processes ExtendedStateMonitorInitMessage by setting up tracking for the requested entity and state properties
|
protectedvirtual |
Finds an extended entity by its identifier.
| entityId | The entity identifier to look up |
Searches the reflected extended entity list for an entity with the given ID
|
protected |
Sends an attribute message with a specific value type.
| ValueType | The type of the attribute value |
| MessageType | The type of message to create and send |
| name | The name of the attribute |
| value | The value of the attribute |
| entityId | The entity identifier to associate with the message |
Creates and queues a message containing the attribute name, value, and entity ID
References makVre::DtConnector::name().
|
protected |
Sends a state property message with type conversion.
| RwType | The reader/writer type for the property |
| ValueType | The target value type |
| MessageType | The type of message to create and send |
| entity | Pointer to the entity containing the property |
| name | The name of the state property |
Looks up a property of the specified reader/writer type, converts it to the target value type, and sends it in a message of the specified message type
References makVre::DtConnector::name().
|
protectedvirtual |
Sends an extended data message for a specific entity.
| entity | Pointer to the entity containing the extended data |
| name | The name of the extended data property |
| type | The type of the extended data property |
Creates and sends a message containing extended data from the entity
References makVre::DtConnector::name(), and makVre::DtConnector::type().
|
protectedvirtual |
Sends a state property message with type dispatching.
| entity | Pointer to the entity containing the property |
| name | The name of the state property |
| type | The type of the state property ("bool", "int", "float", "string", "ammoClipMap") |
Dispatches to the appropriate typed sendStatePropertyMessage based on the type string
References makVre::DtConnector::name(), and makVre::DtConnector::type().
|
protected |
Logs a warning about missing extended state data.
| name | The name of the missing state property |
| type | The type of the missing state property |
Logs a warning message the first time a specific state property is not found. Subsequent missing properties with the same name and type won't generate additional log messages to prevent log spam.
References makVre::DtConnector::name(), and makVre::DtConnector::type().
|
protected |
Mapping of state names to their types.
|
protected |
Mapping of property names to their types.
|
protected |
Entity identifier for the monitored entity.
|
protected |
Global object designator for the monitored entity.
|
protected |
Pointer to the reflected extended entity list.
|
protected |
Cache for extended state data that is missing.
Used to limit the amount of warning messages put into the log by tracking which properties have already had warnings issued