VR-Engage  2.2
Loading...
Searching...
No Matches
ifRadarStateRequest.h
Go to the documentation of this file.
1/*******************************************************************************
2** Copyright (c) 2025 MAK Technologies
3** All rights reserved.
4*******************************************************************************/
5
6//! \file ifRadarStateRequest.h
7//! \ingroup vreVrfMessages
8//! \brief Interface message class for requesting radar state data
9//!
10//! This file defines the DtIfRadarStateRequest class, which is used to request
11//! radar state information from a DtVreRadarObjectSensor. It allows for both
12//! one-time requests and subscription-based continuous updates.
13
14//! The DtIfRadarStateRequest class provides a mechanism for requesting radar
15//! state data from a radar object sensor in the simulation system.
16
17#pragma once
18
20
21#include <vlutil/vlString.h>
22#include <vrfExtProtocol/simInterfaceContent.h>
23#include <vrfutil/rwUUID.h>
24
25
26//! \brief Interface message for requesting radar state data
27//!
28//! This class is used to request radar state data messages to be sent from a
29//! DtVreRadarObjectSensor. Two types of requests are supported:
30//!
31//! - If subscribe is true, the request indicates that a new radar state data
32//! message should be sent every time the radar state changes, until a
33//! DtRadarStateUnsubscribe message is sent to cancel the subscription.
34//!
35//! - If subscribe is false, the request is for just one message containing the
36//! current radar state to be sent.
37class VRFMESSAGES_DLL DtIfRadarStateRequest : public DtSimInterfaceContent
38{
39public:
40 //! \brief Default constructor
41 //!
42 //! Initializes an empty radar state request message.
44
45 //! \brief Copy constructor
46 //! \param orig The radar state request to copy from
47 //!
48 //! Creates a new radar state request message by copying an existing one.
50
51 //! \brief Assignment operator
52 //! \param orig The radar state request to copy from
53 //! \return Reference to this object after assignment
54 //!
55 //! Copies the contents of another radar state request message into this one.
57
58 //! \brief Virtual destructor
59 virtual ~DtIfRadarStateRequest() override;
60
61 //! \brief Gets the interface message type
62 //! \return The message type identifier
63 //!
64 //! Returns DtRadarStateRequestMessageType as defined in vreVrfMessageTypes.h.
65 virtual int type() const override;
66
67 //! \brief Creates a copy of this message
68 //! \return Pointer to the new copy
69 //!
70 //! Creates a dynamically allocated copy of this message.
71 virtual DtSimInterfaceContent* clone() const override;
72
73 //! \brief Sets the subscription flag
74 //! \param value True for continuous updates, false for a one-time request
75 //!
76 //! When set to true, radar state data will be sent every time the data changes.
77 //! When set to false, only a single radar state update will be sent.
78 virtual void setSubscribe(bool value);
79
80 //! \brief Gets the subscription flag
81 //! \return True if requesting continuous updates, false for a one-time request
82 virtual bool subscribe() const;
83
84 //! \brief Sets the UUID of the entity whose radar state is being requested
85 //! \param uuid The entity UUID to set
86 //!
87 //! Sets the UUID of the entity whose radar state data is being requested.
88 //! This identifies the specific radar system in the simulation.
89 virtual void setUUID(const DtUUID& uuid);
90
91 //! \brief Gets the UUID of the entity whose radar state is being requested
92 //! \return The entity UUID
93 virtual const DtUUID& uuid() const;
94
95 //! \brief Gets the network representation size
96 //! \return Size in bytes of the network representation
97 //!
98 //! Returns the size of the network buffer needed to store this message.
99 virtual int netRepSize() const override;
100
101 //! \brief Deserializes the message from a network buffer
102 //! \param contentBuffer Pointer to the network buffer
103 //! \param contentSize Size of the buffer in bytes
104 //! \return True if deserialization was successful
105 //!
106 //! Fills the message from the provided network buffer.
107 virtual bool setFromNet(const char* contentBuffer, unsigned contentSize) override;
108
109 //! \brief Serializes the message for network transmission
110 //! \return True if serialization was successful
111 //!
112 //! Prepares the message for network transmission.
113 virtual bool setToNet() override;
114
115 //! \brief Formats the message data as a string
116 //! \param str String to store the formatted message data
117 //!
118 //! Appends a human-readable representation of the message to the provided string.
119 virtual void printDataToString(DtString& str) override;
120
121 //! \brief Static creator function for factory registration
122 //! \return Pointer to a new instance of DtIfRadarStateRequest
123 //!
124 //! This static function is used for registration with DtInterfaceContentFactory.
125 static DtSimInterfaceContent* creator();
126
127protected:
128 //! \brief UUID of the entity whose radar state is being requested
129 DtUUID myUUID;
130
131 //! \brief Flag indicating whether continuous updates are requested
132 //! When true, data will be sent each time it changes. When false, only a single update is sent.
134};
virtual void printDataToString(DtString &str) override
Formats the message data as a string.
virtual bool setToNet() override
Serializes the message for network transmission.
virtual bool subscribe() const
Gets the subscription flag.
bool mySubscribe
Flag indicating whether continuous updates are requested When true, data will be sent each time it ch...
Definition ifRadarStateRequest.h:133
const DtIfRadarStateRequest & operator=(const DtIfRadarStateRequest &orig)
Assignment operator.
DtUUID myUUID
UUID of the entity whose radar state is being requested.
Definition ifRadarStateRequest.h:129
static DtSimInterfaceContent * creator()
Static creator function for factory registration.
DtIfRadarStateRequest()
Default constructor.
virtual int netRepSize() const override
Gets the network representation size.
virtual const DtUUID & uuid() const
Gets the UUID of the entity whose radar state is being requested.
virtual ~DtIfRadarStateRequest() override
Virtual destructor.
virtual int type() const override
Gets the interface message type.
virtual bool setFromNet(const char *contentBuffer, unsigned contentSize) override
Deserializes the message from a network buffer.
DtIfRadarStateRequest(const DtIfRadarStateRequest &orig)
Copy constructor.
virtual void setUUID(const DtUUID &uuid)
Sets the UUID of the entity whose radar state is being requested.
virtual void setSubscribe(bool value)
Sets the subscription flag.
virtual DtSimInterfaceContent * clone() const override
Creates a copy of this message.
Export/import macros for the VRF Messages library.
#define VRFMESSAGES_DLL
Definition export.h:23