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

Detailed Description

This class is used to inform a VRForces back-end that an entity is being controlled by a VREngage player station. The message includes the identity of the controlling application, station information, and role information (e.g., gunner, driver, commander, or entity-level control).

#include <setVreControlled.h>

Inheritance diagram for makVre::DtSetVreControlledRequest:
[legend]

Public Member Functions

 DtSetVreControlledRequest ()
 
 DtSetVreControlledRequest (const DtString &writeName, DtReaderWriterRegistry *parentRegistry=0)
 
 DtSetVreControlledRequest (const DtString &writeName, const DtSetVreControlledRequest &orig, DtReaderWriterRegistry *parentRegistry=0)
 
const DtSetVreControlledRequest & operator= (const DtSetVreControlledRequest &orig)
 
virtual ~DtSetVreControlledRequest () override
 
virtual const DtSetMessageType & type () const override
 
virtual DtSetDataRequest * clone (const DtString &name, DtReaderWriterRegistry *parentRegistry=0) const override
 
virtual DtString stringRep () const override
 
virtual DtSimulationAddress simulationAddress () const
 
virtual void setSimulationAddress (const DtSimulationAddress &address)
 
virtual std::string stationId () const
 
virtual void setStationId (const std::string &id)
 
virtual bool playerStationControlled () const
 
virtual void setPlayerStationControlled (bool trueFalse)
 
virtual std::vector< std::string > roles () const
 
virtual void setRoles (const std::vector< std::string > &description)
 
virtual std::string roleName () const
 
virtual void setRoleName (const std::string &roleName)
 
virtual int netRepSize () const override
 
virtual bool setFromNet (const char *contentBuffer, unsigned contentSize) override
 
virtual bool setToNet () override
 

Static Public Member Functions

static DtSetDataRequest * creator ()
 

Protected Attributes

DtRwSimulationAddress mySimulationAddress
 
DtRwString myStationId
 
DtRwString myRoleName
 
DtRwBoolean myIsPlayerStationControlled
 
DtRwStringList myRoleTypes
 

Constructor & Destructor Documentation

◆ DtSetVreControlledRequest() [1/3]

makVre::DtSetVreControlledRequest::DtSetVreControlledRequest ( )

Default constructor.

Initializes an empty VREngage control state request.

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

◆ DtSetVreControlledRequest() [2/3]

makVre::DtSetVreControlledRequest::DtSetVreControlledRequest ( const DtString & writeName,
DtReaderWriterRegistry * parentRegistry = 0 )

Named constructor for reader/writer functionality.

Parameters
writeNameThe name to identify this request
parentRegistryOptional reader-writer registry for serialization

If you have a request 'put' itself, the writeName will preface it.

◆ DtSetVreControlledRequest() [3/3]

makVre::DtSetVreControlledRequest::DtSetVreControlledRequest ( const DtString & writeName,
const DtSetVreControlledRequest & orig,
DtReaderWriterRegistry * parentRegistry = 0 )

Copy constructor.

Parameters
writeNameThe name to identify this request
origThe request to copy from
parentRegistryOptional reader-writer registry for serialization

Creates a new request by copying an existing one.

References DtSetVreControlledRequest().

◆ ~DtSetVreControlledRequest()

virtual makVre::DtSetVreControlledRequest::~DtSetVreControlledRequest ( )
overridevirtual

Virtual destructor.

Member Function Documentation

◆ operator=()

const DtSetVreControlledRequest & makVre::DtSetVreControlledRequest::operator= ( const DtSetVreControlledRequest & orig)

Assignment operator.

Parameters
origThe request to copy from
Returns
Reference to this object after assignment

Copies the contents of another request into this one.

References DtSetVreControlledRequest().

◆ type()

virtual const DtSetMessageType & makVre::DtSetVreControlledRequest::type ( ) const
overridevirtual

Gets the message type.

Returns
The message type identifier

Returns DtSetVreControlledType as the message type identifier.

◆ clone()

virtual DtSetDataRequest * makVre::DtSetVreControlledRequest::clone ( const DtString & name,
DtReaderWriterRegistry * parentRegistry = 0 ) const
overridevirtual

Creates a copy of this request.

Parameters
nameThe name to identify the cloned request
parentRegistryOptional reader-writer registry for serialization
Returns
Pointer to a new dynamically allocated copy

Creates a deep copy of the request for factory system use.

◆ stringRep()

virtual DtString makVre::DtSetVreControlledRequest::stringRep ( ) const
overridevirtual

Gets a human-readable string representation.

Returns
String containing a human-readable representation of the request

Provides a human-readable representation of this request for debugging and logging.

◆ simulationAddress()

virtual DtSimulationAddress makVre::DtSetVreControlledRequest::simulationAddress ( ) const
virtual

Gets the simulation address of the player station.

Returns
The simulation address of the controlling player station

Returns the simulation address of the VREngage player station that is controlling the entity.

◆ setSimulationAddress()

virtual void makVre::DtSetVreControlledRequest::setSimulationAddress ( const DtSimulationAddress & address)
virtual

Sets the simulation address of the player station.

Parameters
addressThe simulation address to set

Sets the simulation address of the VREngage player station that is controlling the entity.

◆ stationId()

virtual std::string makVre::DtSetVreControlledRequest::stationId ( ) const
virtual

Gets the published ID of the player station.

Returns
The unique ID of the controlling player station

Returns the unique identifier for the VREngage player station that is controlling the entity.

◆ setStationId()

virtual void makVre::DtSetVreControlledRequest::setStationId ( const std::string & id)
virtual

Sets the published ID of the player station.

Parameters
idThe unique ID to set

Sets the unique identifier for the VREngage player station that is controlling the entity.

◆ playerStationControlled()

virtual bool makVre::DtSetVreControlledRequest::playerStationControlled ( ) const
virtual

Gets the player station control state.

Returns
True if the entity is player station controlled, false otherwise

Returns whether the entity is currently controlled by a VREngage player station.

◆ setPlayerStationControlled()

virtual void makVre::DtSetVreControlledRequest::setPlayerStationControlled ( bool trueFalse)
virtual

Sets the player station control state.

Parameters
trueFalseTrue to enable player station control, false to disable

Sets whether the entity is controlled by a VREngage player station. When set to false, this can be used to release control back to AI.

◆ roles()

virtual std::vector< std::string > makVre::DtSetVreControlledRequest::roles ( ) const
virtual

Gets the controlled role types for the entity.

Returns
List of role-type strings indicating which role entries are controlled

Returns a list of strings indicating which role-type keys are controlled by the VREngage player station, such as "gunner", "driver", "commander", or "entity" for entity-level control.

◆ setRoles()

virtual void makVre::DtSetVreControlledRequest::setRoles ( const std::vector< std::string > & description)
virtual

Sets the controlled role types for the entity.

Parameters
descriptionList of role-type strings indicating which role entries are controlled

Sets the list of strings indicating which role-type keys are controlled by the VREngage player station, such as "gunner", "driver", "commander", or "entity" for entity-level control.

◆ roleName()

virtual std::string makVre::DtSetVreControlledRequest::roleName ( ) const
virtual

Gets the entity-role name associated with the control request.

Returns
The entity-role name stored in the request.

Returns the role name that should be written into the "Role" field of the structured station entry in the published "Roles" state property.

Referenced by setRoleName().

◆ setRoleName()

virtual void makVre::DtSetVreControlledRequest::setRoleName ( const std::string & roleName)
virtual

Sets the entity-role name associated with the control request.

Parameters
roleNameThe entity-role name to store in the request.

Sets the role name that should be written into the "Role" field of the structured station entry in the published "Roles" state property.

References roleName().

◆ netRepSize()

virtual int makVre::DtSetVreControlledRequest::netRepSize ( ) const
overridevirtual

Gets the network representation size.

Returns
Size in bytes of the network representation

Returns the size of the network buffer needed to store this request, padded to an 8-byte boundary for alignment.

◆ setFromNet()

virtual bool makVre::DtSetVreControlledRequest::setFromNet ( const char * contentBuffer,
unsigned contentSize )
overridevirtual

Deserializes the request from a network buffer.

Parameters
contentBufferPointer to the network buffer
contentSizeSize of the buffer in bytes
Returns
True if deserialization was successful

Fills the request from the provided network buffer.

◆ setToNet()

virtual bool makVre::DtSetVreControlledRequest::setToNet ( )
overridevirtual

Serializes the request for network transmission.

Returns
True if serialization was successful

Fills in the network buffer (created by base class setDataRequest) with the request contents for transmission.

◆ creator()

static DtSetDataRequest * makVre::DtSetVreControlledRequest::creator ( )
static

Static creator function for factory registration.

Returns
Pointer to a new instance of DtSetVreControlledRequest

This static function is used for registration with the request factory system.

Member Data Documentation

◆ mySimulationAddress

DtRwSimulationAddress makVre::DtSetVreControlledRequest::mySimulationAddress
protected

Simulation address of the controlling player station.

◆ myStationId

DtRwString makVre::DtSetVreControlledRequest::myStationId
protected

Unique identifier for the controlling player station.

◆ myRoleName

DtRwString makVre::DtSetVreControlledRequest::myRoleName
protected

Entity-role name stored for the structured "Role" field.

◆ myIsPlayerStationControlled

DtRwBoolean makVre::DtSetVreControlledRequest::myIsPlayerStationControlled
protected

Flag indicating whether the entity is player station controlled.

◆ myRoleTypes

DtRwStringList makVre::DtSetVreControlledRequest::myRoleTypes
protected

List of role-type keys that are controlled.

Contains strings like "gunner", "driver", "commander", or "entity".


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