VR-Engage  2.3
Loading...
Searching...
No Matches
makVre::DtVreCustomReflectedEntityList Class Reference

Detailed Description

Extends the base custom reflected entity list to provide VREngage-specific functionality, including parameter database handling and interaction with simulation model sets.

#include <vreVrvExtensions.h>

Inheritance diagram for makVre::DtVreCustomReflectedEntityList:
[legend]

Public Member Functions

 DtVreCustomReflectedEntityList (makVrv::DT_PROTOCOL_NAMESPACE::DtEntityElementProcessor &listener)
 
 DtVreCustomReflectedEntityList (makVrv::DT_PROTOCOL_NAMESPACE::DtEntityElementProcessor &listener, const DtDDMRegionSet &regionsToUse)
 
virtual ~DtVreCustomReflectedEntityList () override
 
virtual void initialize ()
 
virtual bool readyToAdd (DtReflectedObject *obj) override
 
virtual void entityRemoved (DtReflectedEntity *ent) override
 
virtual void entityUpdated (DtReflectedEntity *ent) override
 
DtVrfParameterDb * parameterDatabase ()
 

Protected Types

using InitializedTypeMap = std::map<DtReflectedObject*, DtEntityType>
 
using MissingTypeSet = std::set<DtEntityType>
 

Protected Member Functions

virtual void refreshReflectedEntityProperties ()
 
virtual void discoverEntityIfNecessary (DtReflectedObject *obj, DtExtEntityStateRepository *entSR)
 
virtual DtVreMessageResult handleSessionSmsList (DtVreMessage *msg)
 
virtual void drawStatePropertyTraceMenu ()
 
virtual void traceStatePropertyReception (DtExtEntityStateRepository *entSR)
 

Protected Attributes

DtSmsLoader mySmsLoader
 
std::vector< std::string > mySms
 
InitializedTypeMap myInitializedWithType
 
MissingTypeSet myMissingTypes
 
std::atomic< bool > myStatePropertyTraceEnabled {false}
 
std::mutex myTracedPropertyMutex
 
std::string myTracedPropertyName
 
char myTracedPropertyInputBuffer [64] = {}
 
std::map< const void *, std::pair< size_t, std::string > > myTraceLastLogged
 

Member Typedef Documentation

◆ InitializedTypeMap

using makVre::DtVreCustomReflectedEntityList::InitializedTypeMap = std::map<DtReflectedObject*, DtEntityType>
protected

Type alias for mapping reflected objects to entity types.

◆ MissingTypeSet

using makVre::DtVreCustomReflectedEntityList::MissingTypeSet = std::set<DtEntityType>
protected

Type alias for the set of missing entity types.

Constructor & Destructor Documentation

◆ DtVreCustomReflectedEntityList() [1/2]

makVre::DtVreCustomReflectedEntityList::DtVreCustomReflectedEntityList ( makVrv::DT_PROTOCOL_NAMESPACE::DtEntityElementProcessor & listener)
inline

Constructor for non-HLA protocols.

Parameters
listenerReference to the entity element processor that will receive entity events

◆ DtVreCustomReflectedEntityList() [2/2]

makVre::DtVreCustomReflectedEntityList::DtVreCustomReflectedEntityList ( makVrv::DT_PROTOCOL_NAMESPACE::DtEntityElementProcessor & listener,
const DtDDMRegionSet & regionsToUse )
inline

Constructor for HLA protocol.

Parameters
listenerReference to the entity element processor that will receive entity events
regionsToUseReference to the DDM regions to use for this entity list

◆ ~DtVreCustomReflectedEntityList()

virtual makVre::DtVreCustomReflectedEntityList::~DtVreCustomReflectedEntityList ( )
overridevirtual

Virtual destructor.

Removes message handlers registered during initialization

Member Function Documentation

◆ initialize()

virtual void makVre::DtVreCustomReflectedEntityList::initialize ( )
virtual

Initializes the reflected entity list.

Registers parameter factories, the SMS message handler, and debug controls. Called during reflected-list creation, after the connector's signal_exerciseConnectionCreated callback registers the network dispatch thread.

◆ readyToAdd()

virtual bool makVre::DtVreCustomReflectedEntityList::readyToAdd ( DtReflectedObject * obj)
overridevirtual

Determines whether a reflected object is ready to join the list.

Parameters
objPointer to the reflected object to check.
Returns
True when the object is ready to be added.

Initializes the state-property schema and applies retained extended attributes before the object is announced to list consumers.

◆ entityRemoved()

virtual void makVre::DtVreCustomReflectedEntityList::entityRemoved ( DtReflectedEntity * ent)
overridevirtual

Handles removal of a reflected entity.

Parameters
entPointer to the entity being removed

Removes cached initialization state before the entity pointer can be reused for a subsequently reflected entity.

◆ entityUpdated()

virtual void makVre::DtVreCustomReflectedEntityList::entityUpdated ( DtReflectedEntity * ent)
overridevirtual

Handles entity updates.

Parameters
entPointer to the entity that was updated

Overridden function to process entity updates

◆ parameterDatabase()

DtVrfParameterDb * makVre::DtVreCustomReflectedEntityList::parameterDatabase ( )

Gets the parameter database associated with this entity list.

Returns
Non-owning pointer to the parameter database, or nullptr before loading.

Returns the SMS loader's database. A non-null pointer alone does not indicate that the most recent load succeeded.

◆ refreshReflectedEntityProperties()

virtual void makVre::DtVreCustomReflectedEntityList::refreshReflectedEntityProperties ( )
protectedvirtual

Rebuilds reflected EESR state-property schemas after an SMS reload.

Clears cached entity-type initialization state, then reinitializes each reflected EESR from the current SMS parameter database. EESR initialization replays retained extended attributes into the rebuilt schema. Checks that the database and extended repositories are available.

◆ discoverEntityIfNecessary()

virtual void makVre::DtVreCustomReflectedEntityList::discoverEntityIfNecessary ( DtReflectedObject * obj,
DtExtEntityStateRepository * entSR )
protectedvirtual

Discovers and initializes an entity with parameter data.

Parameters
objPointer to the reflected object to discover
entSRPointer to the entity state repository

Defers discovery until the SMS database and entity type are available. Initializes from matching SMS parameters and checks the resulting initialized flag and state/parameter property counts. Missing parameter types are logged once per SMS refresh.

◆ handleSessionSmsList()

virtual DtVreMessageResult makVre::DtVreCustomReflectedEntityList::handleSessionSmsList ( DtVreMessage * msg)
protectedvirtual

Handles simulation model set list messages.

Parameters
msgPointer to the message containing the SMS list
Returns
Message result indicating how the message was handled

Logs SMS receipt and load outcomes, and refreshes entity schemas after a successful reload. Checks database availability for an unchanged cached list.

Note
The completion acknowledgment is sent even if loading fails.

◆ drawStatePropertyTraceMenu()

virtual void makVre::DtVreCustomReflectedEntityList::drawStatePropertyTraceMenu ( )
protectedvirtual

Draws the state-property reception trace controls in the debug menu.

Runs on the render thread as a DtVreDebugManager menu callback. All ImGui calls are confined to this method because ImGui is not thread safe. The controls only exchange data with the network thread through myStatePropertyTraceEnabled and the mutex-guarded myTracedPropertyName.

◆ traceStatePropertyReception()

virtual void makVre::DtVreCustomReflectedEntityList::traceStatePropertyReception ( DtExtEntityStateRepository * entSR)
protectedvirtual

Logs extended-attribute (state property) reception for a reflected entity.

Parameters
entSRPointer to the entity state repository to inspect.

Runs on the network-processing thread from entityUpdated() before the base class consumes pending attribute updates; all reads are non-destructive (markAsRead=false). Logs the traced property's value when it changes and dumps the attribute inventory when its size changes. Does nothing unless enabled from the debug menu.

Member Data Documentation

◆ mySmsLoader

DtSmsLoader makVre::DtVreCustomReflectedEntityList::mySmsLoader
protected

Loader for simulation model sets.

◆ mySms

std::vector<std::string> makVre::DtVreCustomReflectedEntityList::mySms
protected

Simulation model set filenames from the most recent successful load.

◆ myInitializedWithType

InitializedTypeMap makVre::DtVreCustomReflectedEntityList::myInitializedWithType
protected

Map of reflected objects to their entity types.

Tracks which entities have been initialized with which entity types

◆ myMissingTypes

MissingTypeSet makVre::DtVreCustomReflectedEntityList::myMissingTypes
protected

Set of entity types we know aren't in the parameter database.

This prevents entities with unknown parameter types from searching the parameter database every time there's a network update

◆ myStatePropertyTraceEnabled

std::atomic<bool> makVre::DtVreCustomReflectedEntityList::myStatePropertyTraceEnabled {false}
protected

Whether state-property reception tracing is enabled.

Written by the debug menu on the render thread and read by traceStatePropertyReception() on the network thread.

◆ myTracedPropertyMutex

std::mutex makVre::DtVreCustomReflectedEntityList::myTracedPropertyMutex
protected

Guards myTracedPropertyName, which is shared between threads.

◆ myTracedPropertyName

std::string makVre::DtVreCustomReflectedEntityList::myTracedPropertyName
protected

Name of the state property whose value changes are traced.

Empty means only attribute-inventory changes are logged. Guarded by myTracedPropertyMutex.

◆ myTracedPropertyInputBuffer

char makVre::DtVreCustomReflectedEntityList::myTracedPropertyInputBuffer[64] = {}
protected

ImGui edit buffer for the traced property name.

Only touched on the render thread inside drawStatePropertyTraceMenu().

◆ myTraceLastLogged

std::map<const void*, std::pair<size_t, std::string> > makVre::DtVreCustomReflectedEntityList::myTraceLastLogged
protected

Last logged (attribute count, traced value) per state repository.

Used for change detection so the trace only logs transitions. Only touched on the network thread.


The documentation for this class was generated from the following file: