VR-Engage  2.2
Loading...
Searching...
No Matches
icVreTdlTrackList.h
Go to the documentation of this file.
1/*******************************************************************************
2** Copyright (c) 2025 MAK Technologies
3** All rights reserved.
4*******************************************************************************/
5
6//! \file icVreTdlTrackList.h
7//! \ingroup vreVrfMessages
8//! \brief Interface class for Tactical Data Link (TDL) track list information
9//!
10//! This file defines the IcVreTdlTrackList class, which encapsulates a collection of
11//! TDL tracks for transmission between simulation components. It provides mechanisms
12//! for managing track lists and network serialization/deserialization.
13
14#pragma once
15
16#include "icVreTdlTrack.h"
17
18// VR-Engage includes
20
21// VR-Forces includes
22#include <vrfExtProtocol/simInterfaceContent.h>
23#include <vrfutil/rwUUID.h>
24
25// VR-Link includes
26#include <vlutil/vlString.h>
27
28// #include "TDLMessageTypes.h"
29
30#include <list>
31
32namespace ctiTdl
33{
34//! \brief Message type identifier for TDL track list messages
35const int IcVreTdlTrackListType = 602;
36
37//! \brief Interface message class for a collection of TDL tracks
38//!
39//! This class encapsulates a collection of TDL tracks for transmission between
40//! simulation components. It manages a list of track contents structures and
41//! provides methods for serialization and deserialization over the network.
42class VRFMESSAGES_DLL IcVreTdlTrackList : public DtSimInterfaceContent
43{
44public:
45 //! \brief Default constructor
46 //!
47 //! Initializes an empty TDL track list message.
49
50 //! \brief Virtual destructor
51 //!
52 //! Cleans up all resources associated with the track list.
53 virtual ~IcVreTdlTrackList() override;
54
55 //! \brief Copy constructor
56 //! \param orig The TDL track list to copy from
57 //!
58 //! Creates a new TDL track list by copying an existing one,
59 //! including all contained tracks.
61
62 //! \brief Assignment operator
63 //! \param orig The TDL track list to copy from
64 //! \return Reference to this object after assignment
65 //!
66 //! Copies the contents of another TDL track list into this one,
67 //! including all contained tracks.
69
70 //! \brief Gets the interface message type
71 //! \return The message type identifier
72 //!
73 //! Returns IcVreTdlTrackListType.
74 virtual int type() const override;
75
76 //! \brief Creates a copy of this message
77 //! \return Pointer to the new copy
78 //!
79 //! Creates a dynamically allocated copy of this message using the copy constructor.
80 virtual DtSimInterfaceContent* clone() const override;
81
82 //! \brief Static creator function for factory registration
83 //! \return Pointer to a new instance of IcVreTdlTrackList
84 //!
85 //! This static function is used for registration with DtInterfaceContentFactory.
86 static DtSimInterfaceContent* creator();
87
88 //! \brief Gets the network representation size
89 //! \return Size in bytes of the network representation
90 //!
91 //! Returns the size of the full network representation padded to an 8-byte boundary.
92 virtual int netRepSize() const override;
93
94 //! \brief Deserializes the message from a network buffer
95 //! \param contentBuffer Pointer to the network buffer
96 //! \param contentSize Size of the buffer in bytes
97 //! \return True if deserialization was successful
98 //!
99 //! Fills the track list from the provided network buffer.
100 virtual bool setFromNet(const char* contentBuffer, unsigned contentSize) override;
101
102 //! \brief Serializes the message for network transmission
103 //! \return True if serialization was successful
104 //!
105 //! Prepares the track list for network transmission.
106 virtual bool setToNet() override;
107
108 //! \brief Formats the message data as a string
109 //! \param str String to store the formatted message data
110 //!
111 //! Appends a human-readable representation of the track list to the provided string.
112 virtual void printDataToString(DtString& str) override;
113
114 //! \brief Sets the UUID for this track list
115 //! \param uuid The UUID to set
116 virtual void setUUID(DtUUID uuid);
117
118 //! \brief Gets the UUID of this track list
119 //! \return The track list's UUID
120 virtual DtUUID getUUID();
121
122 //! \brief Sets the source track number
123 //! \param stn The source track number to set
124 //!
125 //! Sets the track number of the originating Joint Unit (JU).
126 virtual void setSourceTrackNumber(const DtString& stn);
127
128 //! \brief Gets the source track number
129 //! \return The source track number of the originating Joint Unit
130 virtual DtString getSourceTrackNumber();
131
132 //! \brief Sets the clear all tracks flag
133 //! \param clear True to clear all tracks, false otherwise
134 //!
135 //! When set to true, this flag indicates that all tracks and engagement
136 //! status should be deleted/cleared by the receiver.
137 virtual void setClearAllTracks(const bool clear);
138
139 //! \brief Gets the clear all tracks flag
140 //! \return True if all tracks should be cleared, false otherwise
141 virtual bool getClearAllTracks();
142
143 //! \brief Adds a track to the track list
144 //! \param track The track contents to add
145 //!
146 //! Adds a track to the list of tracks in this message.
147 virtual void addTrack(const IcVreTdlTrackContents& track);
148
149 //! \brief Gets the list of tracks
150 //! \return Reference to the list of track contents
151 //!
152 //! Returns a reference to the internal list of tracks.
153 virtual std::list<IcVreTdlTrackContents>& getTrackList();
154
155protected:
156 //! \brief UUID of this track list for unique identification
157 DtUUID myUUID;
158
159 //! \brief Source track number (STN) of originating Joint Unit (JU)
161
162 //! \brief Flag indicating if all tracks should be cleared
163 //! When true, all tracks and engagement status should be deleted/cleared
165
166 //! \brief Count of tracks in the list
167 //! Maximum of 40 tracks, sorted by distance from ownship
169
170 //! \brief List of track contents structures
171 std::list<IcVreTdlTrackContents> myTrackList;
172};
173} // namespace ctiTdl
static DtSimInterfaceContent * creator()
Static creator function for factory registration.
bool myClearAllTracks
Flag indicating if all tracks should be cleared When true, all tracks and engagement status should be...
Definition icVreTdlTrackList.h:164
DtUUID myUUID
UUID of this track list for unique identification.
Definition icVreTdlTrackList.h:157
virtual void setSourceTrackNumber(const DtString &stn)
Sets the source track number.
IcVreTdlTrackList & operator=(const IcVreTdlTrackList &orig)
Assignment operator.
IcVreTdlTrackList(const IcVreTdlTrackList &orig)
Copy constructor.
int myTrackCount
Count of tracks in the list Maximum of 40 tracks, sorted by distance from ownship.
Definition icVreTdlTrackList.h:168
IcVreTdlTrackList()
Default constructor.
virtual void addTrack(const IcVreTdlTrackContents &track)
Adds a track to the track list.
virtual std::list< IcVreTdlTrackContents > & getTrackList()
Gets the list of tracks.
virtual DtString getSourceTrackNumber()
Gets the source track number.
virtual void setUUID(DtUUID uuid)
Sets the UUID for this track list.
DtString mySourceTrackNumber
Source track number (STN) of originating Joint Unit (JU)
Definition icVreTdlTrackList.h:160
virtual bool setFromNet(const char *contentBuffer, unsigned contentSize) override
Deserializes the message from a network buffer.
virtual bool setToNet() override
Serializes the message for network transmission.
virtual void setClearAllTracks(const bool clear)
Sets the clear all tracks flag.
virtual bool getClearAllTracks()
Gets the clear all tracks flag.
virtual int type() const override
Gets the interface message type.
virtual int netRepSize() const override
Gets the network representation size.
virtual DtUUID getUUID()
Gets the UUID of this track list.
virtual ~IcVreTdlTrackList() override
Virtual destructor.
virtual void printDataToString(DtString &str) override
Formats the message data as a string.
std::list< IcVreTdlTrackContents > myTrackList
List of track contents structures.
Definition icVreTdlTrackList.h:171
virtual DtSimInterfaceContent * clone() const override
Creates a copy of this message.
Interface classes for Tactical Data Link (TDL) track information.
Export/import macros for the VRF Messages library.
#define VRFMESSAGES_DLL
Definition export.h:23
Definition icVreTdlEngagementStatus.h:29
const int IcVreTdlTrackListType
Message type identifier for TDL track list messages.
Definition icVreTdlTrackList.h:35
Structure containing TDL track information.
Definition icVreTdlTrack.h:33