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

Detailed Description

Connection hooks persist enabled-state transitions. Device-request overrides persist count-only changes without duplicating the hook writes. Concrete controllers restore the saved flag and exact request count during first-tick initialization after incoming ownership transfer. No handoff listeners are used. State helpers create VreJoystickControllers.Controllers and its Enabled/RequestCount structure prototype on demand. SMS internal-state-data declarations are not required. The ownership-transfer archive carries the property types, prototype, and values. Static overloads share state persistence with controllers that already inherit the VRF joystick interface, without adding a second interface subobject.

#include <vreJoystickControllerInterface.h>

Inheritance diagram for makVre::DtVreJoystickControllerInterface:
[legend]

Public Member Functions

 DtVreJoystickControllerInterface (DtSimComponent *component, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc)
 
virtual ~DtVreJoystickControllerInterface () override
 
 DtVreJoystickControllerInterface (const DtVreJoystickControllerInterface &)=delete
 
DtVreJoystickControllerInterface & operator= (const DtVreJoystickControllerInterface &)=delete
 
 DtVreJoystickControllerInterface (DtVreJoystickControllerInterface &&)=delete
 
DtVreJoystickControllerInterface & operator= (DtVreJoystickControllerInterface &&)=delete
 

Static Public Member Functions

static void updateJoystickState (DtSimComponent &component, DtLocalObject &owner, bool enabled, int requestCount)
 
static bool restoreJoystickState (DtSimComponent &component, DtLocalObject &owner, bool incomingTransfer, bool &enabled, int &requestCount, bool hasDescriptor)
 

Protected Member Functions

void updateJoystickState ()
 
void restoreJoystickState ()
 
virtual void processJoyDeviceRequest (DtSimMessage *msg) override
 

Static Private Member Functions

static DtRwPropertiesMap * createJoystickStateMap (DtRwProperties &context, DtLocalObject &owner)
 
static DtRwPropertiesStructure * joystickStateProperties (DtSimComponent &component, DtLocalObject &owner, bool create)
 

Private Attributes

DtSimComponent & myJoystickComponent
 
bool myRestoreJoystickState
 

Constructor & Destructor Documentation

◆ DtVreJoystickControllerInterface() [1/3]

makVre::DtVreJoystickControllerInterface::DtVreJoystickControllerInterface ( DtSimComponent * component,
DtLocalObject * owner,
DtSimulationServices * simManager,
DtComponentDescriptor * desc )

Constructs an interface alongside an existing component base.

Parameters
componentNon-null, non-owning component pointer used for controller identity.
ownerThe owning local object.
simManagerSimulation services.
descThe joystick controller descriptor.

Referenced by DtVreJoystickControllerInterface(), DtVreJoystickControllerInterface(), operator=(), and operator=().

◆ ~DtVreJoystickControllerInterface()

virtual makVre::DtVreJoystickControllerInterface::~DtVreJoystickControllerInterface ( )
overridevirtual

Destroys the interface; the VRF base removes its message callbacks.

◆ DtVreJoystickControllerInterface() [2/3]

makVre::DtVreJoystickControllerInterface::DtVreJoystickControllerInterface ( const DtVreJoystickControllerInterface & )
delete

Deleted copy constructor and assignment operator to prevent copying.

References DtVreJoystickControllerInterface().

◆ DtVreJoystickControllerInterface() [3/3]

makVre::DtVreJoystickControllerInterface::DtVreJoystickControllerInterface ( DtVreJoystickControllerInterface && )
delete

Member Function Documentation

◆ updateJoystickState() [1/2]

static void makVre::DtVreJoystickControllerInterface::updateJoystickState ( DtSimComponent & component,
DtLocalObject & owner,
bool enabled,
int requestCount )
static

Writes joystick state for a controller with an existing VRF interface.

Parameters
componentThe component whose full name identifies the state entry.
ownerThe owning local object.
enabledThe existing interface's enabled flag.
requestCountThe existing interface's exact request count.
Note
Creates missing internal-state storage without replacing restored properties.

◆ restoreJoystickState() [1/2]

static bool makVre::DtVreJoystickControllerInterface::restoreJoystickState ( DtSimComponent & component,
DtLocalObject & owner,
bool incomingTransfer,
bool & enabled,
int & requestCount,
bool hasDescriptor )
static

Restores state without accessing another controller's protected interface members.

Parameters
componentThe component whose full name identifies the state entry.
ownerThe owning local object.
incomingTransferTrue only for the first initialization after incoming ownership transfer.
enabledThe existing interface's enabled flag, updated on restoration.
requestCountThe existing interface's request count, updated on restoration.
hasDescriptorWhether the existing interface has a valid joystick descriptor.
Returns
True if enabled state was restored. The caller must then register its original joystick-input callback with its adjusted VRF interface pointer and call joystickConnected(). False means no reconnection is required; malformed state is logged and left unchanged.

◆ operator=() [1/2]

DtVreJoystickControllerInterface & makVre::DtVreJoystickControllerInterface::operator= ( const DtVreJoystickControllerInterface & )
delete

◆ operator=() [2/2]

DtVreJoystickControllerInterface & makVre::DtVreJoystickControllerInterface::operator= ( DtVreJoystickControllerInterface && )
delete

◆ updateJoystickState() [2/2]

void makVre::DtVreJoystickControllerInterface::updateJoystickState ( )
protected

Writes the current enabled flag and request count to this controller's internal-state entry.

Note
Call from joystickConnected() and joystickDisconnected().

◆ restoreJoystickState() [2/2]

void makVre::DtVreJoystickControllerInterface::restoreJoystickState ( )
protected

Restores an incoming controller's saved state during first-tick initialization.

Note
Does not reconnect on ordinary construction, scenario loading, or rewind.

◆ processJoyDeviceRequest()

virtual void makVre::DtVreJoystickControllerInterface::processJoyDeviceRequest ( DtSimMessage * msg)
overrideprotectedvirtual

Keeps the saved count current for requests that do not invoke connection hooks.

Parameters
msgThe original joystick device request message.
Note
Calls the VRF handler once; connection transitions are persisted by their hooks.

◆ createJoystickStateMap()

static DtRwPropertiesMap * makVre::DtVreJoystickControllerInterface::createJoystickStateMap ( DtRwProperties & context,
DtLocalObject & owner )
staticprivate

Creates the typed controller-state map in the supplied context.

Returns
Non-owning pointer to the map owned by context, or nullptr if creation fails.

◆ joystickStateProperties()

static DtRwPropertiesStructure * makVre::DtVreJoystickControllerInterface::joystickStateProperties ( DtSimComponent & component,
DtLocalObject & owner,
bool create )
staticprivate

Finds and validates a controller's state, creating missing storage only when requested.

Returns
Non-owning pointer to the entity-owned state, or nullptr if absent or invalid.

Member Data Documentation

◆ myJoystickComponent

DtSimComponent& makVre::DtVreJoystickControllerInterface::myJoystickComponent
private

Non-owning reference used to identify this controller's state entry.

◆ myRestoreJoystickState

bool makVre::DtVreJoystickControllerInterface::myRestoreJoystickState
private

Remembers incoming conversion because the owner clears it before first-tick initialization.


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