|
VR-Engage
2.2
|
DtRwrMonitor manages the communication of radar warning receiver contact information between an RWR system and visualization systems. It handles subscription requests from clients, maintains a list of current subscribers, and sends RWR data messages when the contact list changes.
#include <rwrMonitor.h>
Public Member Functions | |
| DtRwrMonitor (DtLocalObject *hostObject, const DtRwrContactInfoList *contactInfoList) | |
| virtual | ~DtRwrMonitor () |
| virtual bool | init () |
| virtual void | registerMessageCallbacks () |
| virtual void | processRwrDataRequest (DtSimMessage *msg) |
| virtual void | processRwrDataUnsubscribe (DtSimMessage *msg) |
| virtual void | createAndSendRwrDataMessage () |
| virtual void | notifyTargetsChanged () |
Static Public Member Functions | |
| static void | rwrDataRequestCallback (DtSimMessage *msg, void *usrData) |
| static void | rwrDataUnsubscribeCallback (DtSimMessage *msg, void *usrData) |
Protected Types | |
| using | DtSubscriberListCounter = std::map<DtSimulationAddress, int> |
Protected Member Functions | |
| virtual void | addToSubscriberList (const DtSimulationAddress &add) |
| virtual void | removeFromSubscriberList (const DtSimulationAddress &add) |
| virtual int | numberOfSubscribers () |
Protected Attributes | |
| DtLocalObject * | myHostObject |
| const DtRwrContactInfoList * | myRwrContactList |
| DtSubscriberListCounter | mySubscriberListCounter |
Private Member Functions | |
| DtRwrMonitor () | |
| DtRwrMonitor (const DtRwrMonitor &orig) | |
| const DtRwrMonitor & | operator= (const DtRwrMonitor &orig) |
|
protected |
Type definition for the subscriber list with counter.
Defines the container type used to store simulation addresses of subscribers with a counter for each to track multiple subscriptions from the same client.
|
private |
Default constructor (not implemented)
Default constructor is private and not implemented to prevent creation of instances without proper initialization.
Referenced by DtRwrMonitor(), and operator=().
|
private |
Copy constructor (not implemented)
Copy constructor is private and not implemented to prevent copy construction.
References DtRwrMonitor().
| makVre::DtRwrMonitor::DtRwrMonitor | ( | DtLocalObject * | hostObject, |
| const DtRwrContactInfoList * | contactInfoList ) |
Constructor.
| hostObject | The local object that owns the RWR this monitor is for |
| contactInfoList | Pointer to the RWR contact information list maintained by the RWR |
Creates a new RWR monitor that will handle communication between the specified RWR system and visualization clients.
|
virtual |
Virtual destructor.
Cleans up resources used by the RWR monitor.
|
private |
Assignment operator (not implemented)
Assignment operator is private and not implemented to prevent assignment.
References DtRwrMonitor().
|
virtual |
Initializes the monitor.
Initializes the monitor by registering message callbacks to handle subscription requests from clients. Called after construction.
|
virtual |
Registers message callbacks for RWR data requests.
Registers callback functions to handle rwrDataRequest and rwrDataUnsubscribe messages from visualization clients.
|
static |
Static callback function for RWR data request messages.
| msg | The simulation message containing the request |
| usrData | User data pointer (contains the monitor instance) |
Static function registered as a callback to handle RWR data request messages. Forwards the request to the appropriate monitor instance.
|
virtual |
Processes an RWR data request message.
| msg | The simulation message containing the request |
Handles subscription requests for RWR data, adding the client to the subscriber list and sending initial data.
|
static |
Static callback function for RWR data unsubscribe messages.
| msg | The simulation message containing the unsubscribe request |
| usrData | User data pointer (contains the monitor instance) |
Static function registered as a callback to handle RWR data unsubscribe messages. Forwards the request to the appropriate monitor instance.
|
virtual |
Processes an RWR data unsubscribe message.
| msg | The simulation message containing the unsubscribe request |
Handles unsubscription requests for RWR data, removing the client from the subscriber list.
|
virtual |
Creates and sends an RWR data message to subscribers.
Constructs a DtRwrData message based on the current state of the RWR contact list and sends it to all current subscribers. This provides visualization clients with up-to-date RWR contact information.
|
virtual |
Notifies that the RWR contact list has changed.
Called by the RWR system whenever its contact list changes. This triggers RWR data messages to be sent out to all current subscribers, ensuring they have the latest contact information.
|
protectedvirtual |
Adds a client to the subscriber list.
| add | The simulation address of the client to add |
Adds the specified client address to the list of subscribers for this RWR's data. Maintains a counter for each address to support multiple subscriptions from the same client.
|
protectedvirtual |
Removes a client from the subscriber list.
| add | The simulation address of the client to remove |
Removes one subscription entry for the specified client address from the list of subscribers. Only completely removes the client when all subscription instances are removed.
|
protectedvirtual |
Gets the number of current subscribers.
Returns the count of unique clients currently subscribed to receive RWR data updates.
|
protected |
Pointer to the local object that owns the RWR.
The entity object that owns the RWR this monitor is associated with.
|
protected |
Pointer to the RWR contact information list.
Contains the current list of radar contacts detected by the RWR system.
|
protected |
List of current subscribers with subscription counts.
Contains the simulation addresses of all clients currently subscribed to receive RWR data updates, with a count of subscriptions for each.