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