VR-Engage  2.2
Loading...
Searching...
No Matches
ifRwrData.h
Go to the documentation of this file.
1/*******************************************************************************
2** Copyright (c) 2025 MAK Technologies
3** All rights reserved.
4*******************************************************************************/
5
6//! \file ifRwrData.h
7//! \ingroup vreVrfMessages
8//! \brief Interface message class for RWR (Radar Warning Receiver) data
9//!
10//! This file defines the DtIfRwrData class, which encapsulates the current
11//! internal state of a radar warning receiver (RWR). It includes information
12//! about the entity owning the RWR, the RWR name, and a list of detected
13//! radar emitter contacts.
14
15//! The DtIfRwrData class provides a complete snapshot of an RWR's current state.
16//! It is used to communicate RWR information between simulation components.
17#pragma once
20
21#include <vlutil/vlString.h>
22#include <vrfExtProtocol/simInterfaceContent.h>
23#include <vrfutil/rwUUID.h>
24
25//! \brief Interface message for RWR data
26//!
27//! This class encapsulates the current internal state of a single radar warning
28//! receiver (RWR). It contains information about the entity that owns the RWR,
29//! the RWR's name, and a list of currently detected radar emitter contacts.
30
31class VRFMESSAGES_DLL DtIfRwrData : public DtSimInterfaceContent
32{
33public:
34 //! \brief Default constructor
35 //!
36 //! Initializes an empty RWR data message.
38
39 //! \brief Copy constructor
40 //! \param orig The RWR data to copy from
41 //!
42 //! Creates a new RWR data object by copying an existing one.
44
45 //! \brief Assignment operator
46 //! \param orig The RWR data to copy from
47 //! \return Reference to this object after assignment
48 //!
49 //! Copies the contents of another RWR data object into this one.
50 const DtIfRwrData& operator=(const DtIfRwrData& orig);
51
52 //! \brief Virtual destructor
53 virtual ~DtIfRwrData() override;
54
55 //! \brief Gets the interface message type
56 //! \return The message type identifier
57 //!
58 //! Returns DtRwrDataMessageType as defined in vreVrfMessageTypes.h.
59 virtual int type() const override;
60
61 //! \brief Creates a copy of this message
62 //! \return Pointer to the new copy
63 //!
64 //! Creates a dynamically allocated copy of this message.
65 virtual DtSimInterfaceContent* clone() const override;
66
67 //! \brief Gets the name of the RWR
68 //! \return The RWR name
69 virtual DtString rwrName() const;
70
71 //! \brief Sets the name of the RWR
72 //! \param name The RWR name to set
73 virtual void setRwrName(const DtString& name);
74
75 //! \brief Sets the source entity UUID
76 //! \param entity The UUID of the source entity
77 //!
78 //! Sets the UUID of the entity that owns the RWR system.
79 virtual void setSourceEntity(const DtUUID& entity);
80
81 //! \brief Gets the source entity UUID
82 //! \return The UUID of the source entity
83 //!
84 //! Returns the UUID of the entity that owns the RWR system.
85 virtual const DtUUID& sourceEntity() const;
86
87 //! \brief Gets the list of RWR contacts (const version)
88 //! \return Const reference to the list of RWR contacts
89 //!
90 //! Returns a constant reference to the list of radar contacts detected by the RWR.
91 virtual const DtRwRwrContactInfoList& rwrContactList() const;
92
93 //! \brief Gets the list of RWR contacts (non-const version)
94 //! \return Reference to the list of RWR contacts
95 //!
96 //! Returns a modifiable reference to the list of radar contacts detected by the RWR.
98
99 //! \brief Gets the network representation size
100 //! \return Size in bytes of the network representation
101 //!
102 //! Returns the size of the network buffer needed to store this message.
103 virtual int netRepSize() const override;
104
105 //! \brief Deserializes the message from a network buffer
106 //! \param contentBuffer Pointer to the network buffer
107 //! \param contentSize Size of the buffer in bytes
108 //! \return True if deserialization was successful
109 //!
110 //! Fills the message from the provided network buffer.
111 virtual bool setFromNet(const char* contentBuffer, unsigned contentSize) override;
112
113 //! \brief Serializes the message for network transmission
114 //! \return True if serialization was successful
115 //!
116 //! Prepares the message for network transmission.
117 virtual bool setToNet() override;
118
119 //! \brief Formats the message data as a string
120 //! \param str String to store the formatted message data
121 //!
122 //! Appends a human-readable representation of the message to the provided string.
123 virtual void printDataToString(DtString& str) override;
124
125 //! \brief Static creator function for factory registration
126 //! \return Pointer to a new instance of DtIfRwrData
127 //!
128 //! This static function is used for registration with DtInterfaceContentFactory.
129 static DtSimInterfaceContent* creator();
130
131protected:
132 //! \brief UUID of the entity that owns the RWR
134
135 //! \brief Name of the RWR system
136 DtString myRwrName;
137
138 //! \brief List of radar contacts detected by the RWR
140};
DtIfRwrData()
Default constructor.
virtual int netRepSize() const override
Gets the network representation size.
virtual DtSimInterfaceContent * clone() const override
Creates a copy of this message.
virtual void printDataToString(DtString &str) override
Formats the message data as a string.
virtual ~DtIfRwrData() override
Virtual destructor.
DtRwRwrContactInfoList myRwrContactInfoList
List of radar contacts detected by the RWR.
Definition ifRwrData.h:139
DtString myRwrName
Name of the RWR system.
Definition ifRwrData.h:136
const DtIfRwrData & operator=(const DtIfRwrData &orig)
Assignment operator.
virtual DtString rwrName() const
Gets the name of the RWR.
virtual bool setToNet() override
Serializes the message for network transmission.
virtual int type() const override
Gets the interface message type.
virtual DtRwRwrContactInfoList & rwrContactList()
Gets the list of RWR contacts (non-const version)
DtIfRwrData(const DtIfRwrData &orig)
Copy constructor.
static DtSimInterfaceContent * creator()
Static creator function for factory registration.
virtual void setRwrName(const DtString &name)
Sets the name of the RWR.
virtual const DtUUID & sourceEntity() const
Gets the source entity UUID.
DtUUID mySourceEntity
UUID of the entity that owns the RWR.
Definition ifRwrData.h:133
virtual bool setFromNet(const char *contentBuffer, unsigned contentSize) override
Deserializes the message from a network buffer.
virtual const DtRwRwrContactInfoList & rwrContactList() const
Gets the list of RWR contacts (const version)
virtual void setSourceEntity(const DtUUID &entity)
Sets the source entity UUID.
Export/import macros for the VRF Messages library.
#define VRFMESSAGES_DLL
Definition export.h:23
Defines RWR (Radar Warning Receiver) contact information structure.
DtRwTemplatedListPtr< DtRwRwrContactInfo, true > DtRwRwrContactInfoList
List type for storing multiple RWR contact information entries.
Definition rwRwrContactInfo.h:185