VR-Engage  2.2
Loading...
Searching...
No Matches
DtIfVreSensorDataRequest Class Reference

Detailed Description

Interface message for requesting sensor data

This class is used to request sensor data messages to be sent from a DtObjectSensor. It supports three types of requests: one-time updates, subscriptions for continuous updates, and unsubscribe operations to cancel existing subscriptions.

#include <ifVreSensorDataRequest.h>

Inheritance diagram for DtIfVreSensorDataRequest:
[legend]

Public Types

enum  RequestType { ONE_UPDATE , SUBSCRIBE , UNSUBSCRIBE }
 

Public Member Functions

 DtIfVreSensorDataRequest ()
 
 DtIfVreSensorDataRequest (const DtIfVreSensorDataRequest &orig)
 
const DtIfVreSensorDataRequestoperator= (const DtIfVreSensorDataRequest &orig)
 
virtual ~DtIfVreSensorDataRequest () override
 
virtual int type () const override
 
virtual DtSimInterfaceContent * clone () const override
 
virtual void setUUID (const DtUUID &uuid)
 
virtual const DtUUID & uuid () const
 
virtual void setSensorType (const int type)
 
virtual int sensorType () const
 
virtual void setSubscriberId (const unsigned long id)
 
virtual unsigned long subscriberId () const
 
virtual void setRequestType (const RequestType type)
 
virtual RequestType requestType () const
 
virtual int netRepSize () const override
 
virtual bool setFromNet (const char *contentBuffer, unsigned contentSize) override
 
virtual bool setToNet () override
 
virtual void printDataToString (DtString &str) override
 

Static Public Member Functions

static DtSimInterfaceContent * creator ()
 

Protected Attributes

DtUUID myUUID
 
DtU32 mySensorType
 
DtU64 mySubscriberId
 
DtU32 myRequestType
 

Member Enumeration Documentation

◆ RequestType

Enumeration of available request types.

Enumerator
ONE_UPDATE 

Request a single update of sensor data.

SUBSCRIBE 

Subscribe to receive continuous sensor data updates.

UNSUBSCRIBE 

Cancel an existing subscription.

Constructor & Destructor Documentation

◆ DtIfVreSensorDataRequest() [1/2]

DtIfVreSensorDataRequest::DtIfVreSensorDataRequest ( )

Default constructor.

Initializes an empty sensor data request message.

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

◆ DtIfVreSensorDataRequest() [2/2]

DtIfVreSensorDataRequest::DtIfVreSensorDataRequest ( const DtIfVreSensorDataRequest & orig)

Copy constructor.

Parameters
origThe sensor data request to copy from

Creates a new sensor data request message by copying an existing one.

References DtIfVreSensorDataRequest().

◆ ~DtIfVreSensorDataRequest()

virtual DtIfVreSensorDataRequest::~DtIfVreSensorDataRequest ( )
overridevirtual

Virtual destructor.

Member Function Documentation

◆ operator=()

const DtIfVreSensorDataRequest & DtIfVreSensorDataRequest::operator= ( const DtIfVreSensorDataRequest & orig)

Assignment operator.

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

Copies the contents of another sensor data request message into this one.

References DtIfVreSensorDataRequest().

◆ type()

virtual int DtIfVreSensorDataRequest::type ( ) const
overridevirtual

Gets the interface message type.

Returns
The message type identifier

Returns DtVreSensorDataRequestMessageType as defined in vreVrfMessageTypes.h.

Referenced by setRequestType(), and setSensorType().

◆ clone()

virtual DtSimInterfaceContent * DtIfVreSensorDataRequest::clone ( ) const
overridevirtual

Creates a copy of this message.

Returns
Pointer to the new copy

Creates a dynamically allocated copy of this message.

◆ setUUID()

virtual void DtIfVreSensorDataRequest::setUUID ( const DtUUID & uuid)
virtual

Sets the UUID of the entity whose sensor data is being requested.

Parameters
uuidThe entity UUID to set

Sets the UUID of the entity whose sensor data is being requested. This identifies the specific entity in the simulation that has the sensor.

References uuid().

◆ uuid()

virtual const DtUUID & DtIfVreSensorDataRequest::uuid ( ) const
virtual

Gets the UUID of the entity whose sensor data is being requested.

Returns
The entity UUID

Referenced by setUUID().

◆ setSensorType()

virtual void DtIfVreSensorDataRequest::setSensorType ( const int type)
virtual

Sets the sensor type.

Parameters
typeThe sensor type identifier

Sets the type of sensor for which data is being requested. Sensor types are defined in the system and determine what kind of sensor data will be provided in response.

References type().

◆ sensorType()

virtual int DtIfVreSensorDataRequest::sensorType ( ) const
virtual

Gets the sensor type.

Returns
The sensor type identifier

◆ setSubscriberId()

virtual void DtIfVreSensorDataRequest::setSubscriberId ( const unsigned long id)
virtual

Sets the subscriber identifier.

Parameters
idThe subscriber identifier

Sets the unique identifier for the subscriber requesting the data. This is used to manage multiple subscriptions and route responses.

◆ subscriberId()

virtual unsigned long DtIfVreSensorDataRequest::subscriberId ( ) const
virtual

Gets the subscriber identifier.

Returns
The subscriber identifier

◆ setRequestType()

virtual void DtIfVreSensorDataRequest::setRequestType ( const RequestType type)
virtual

Sets the request type.

Parameters
typeThe request type (ONE_UPDATE, SUBSCRIBE, or UNSUBSCRIBE)

Sets the type of request being made. This determines how the sensor system will handle the request (single update vs. continuous updates).

References type().

◆ requestType()

virtual RequestType DtIfVreSensorDataRequest::requestType ( ) const
virtual

Gets the request type.

Returns
The request type (ONE_UPDATE, SUBSCRIBE, or UNSUBSCRIBE)

◆ netRepSize()

virtual int DtIfVreSensorDataRequest::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 message.

◆ setFromNet()

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

Deserializes the message from a network buffer.

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

Fills the message from the provided network buffer.

◆ setToNet()

virtual bool DtIfVreSensorDataRequest::setToNet ( )
overridevirtual

Serializes the message for network transmission.

Returns
True if serialization was successful

Prepares the message for network transmission.

◆ printDataToString()

virtual void DtIfVreSensorDataRequest::printDataToString ( DtString & str)
overridevirtual

Formats the message data as a string.

Parameters
strString to store the formatted message data

Appends a human-readable representation of the message to the provided string.

◆ creator()

static DtSimInterfaceContent * DtIfVreSensorDataRequest::creator ( )
static

Static creator function for factory registration.

Returns
Pointer to a new instance of DtIfVreSensorDataRequest

This static function is used for registration with DtInterfaceContentFactory.

Member Data Documentation

◆ myUUID

DtUUID DtIfVreSensorDataRequest::myUUID
protected

UUID of the entity whose sensor data is being requested.

◆ mySensorType

DtU32 DtIfVreSensorDataRequest::mySensorType
protected

Type of sensor for which data is being requested.

◆ mySubscriberId

DtU64 DtIfVreSensorDataRequest::mySubscriberId
protected

Unique identifier for the subscriber requesting the data.

◆ myRequestType

DtU32 DtIfVreSensorDataRequest::myRequestType
protected

Type of request (ONE_UPDATE, SUBSCRIBE, or UNSUBSCRIBE)


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