VR-Engage  2.2
Loading...
Searching...
No Matches
makVre::DtRwrMonitor Class Reference

Detailed Description

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 DtRwrContactInfoListmyRwrContactList
 
DtSubscriberListCounter mySubscriberListCounter
 

Private Member Functions

 DtRwrMonitor ()
 
 DtRwrMonitor (const DtRwrMonitor &orig)
 
const DtRwrMonitoroperator= (const DtRwrMonitor &orig)
 

Member Typedef Documentation

◆ DtSubscriberListCounter

using makVre::DtRwrMonitor::DtSubscriberListCounter = std::map<DtSimulationAddress, int>
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.

Constructor & Destructor Documentation

◆ DtRwrMonitor() [1/3]

makVre::DtRwrMonitor::DtRwrMonitor ( )
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=().

◆ DtRwrMonitor() [2/3]

makVre::DtRwrMonitor::DtRwrMonitor ( const DtRwrMonitor & orig)
private

Copy constructor (not implemented)

Copy constructor is private and not implemented to prevent copy construction.

References DtRwrMonitor().

◆ DtRwrMonitor() [3/3]

makVre::DtRwrMonitor::DtRwrMonitor ( DtLocalObject * hostObject,
const DtRwrContactInfoList * contactInfoList )

Constructor.

Parameters
hostObjectThe local object that owns the RWR this monitor is for
contactInfoListPointer 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.

◆ ~DtRwrMonitor()

virtual makVre::DtRwrMonitor::~DtRwrMonitor ( )
virtual

Virtual destructor.

Cleans up resources used by the RWR monitor.

Member Function Documentation

◆ operator=()

const DtRwrMonitor & makVre::DtRwrMonitor::operator= ( const DtRwrMonitor & orig)
private

Assignment operator (not implemented)

Returns
Reference to this object

Assignment operator is private and not implemented to prevent assignment.

References DtRwrMonitor().

◆ init()

virtual bool makVre::DtRwrMonitor::init ( )
virtual

Initializes the monitor.

Returns
True if initialization is successful, false otherwise

Initializes the monitor by registering message callbacks to handle subscription requests from clients. Called after construction.

◆ registerMessageCallbacks()

virtual void makVre::DtRwrMonitor::registerMessageCallbacks ( )
virtual

Registers message callbacks for RWR data requests.

Registers callback functions to handle rwrDataRequest and rwrDataUnsubscribe messages from visualization clients.

◆ rwrDataRequestCallback()

static void makVre::DtRwrMonitor::rwrDataRequestCallback ( DtSimMessage * msg,
void * usrData )
static

Static callback function for RWR data request messages.

Parameters
msgThe simulation message containing the request
usrDataUser 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.

◆ processRwrDataRequest()

virtual void makVre::DtRwrMonitor::processRwrDataRequest ( DtSimMessage * msg)
virtual

Processes an RWR data request message.

Parameters
msgThe simulation message containing the request

Handles subscription requests for RWR data, adding the client to the subscriber list and sending initial data.

◆ rwrDataUnsubscribeCallback()

static void makVre::DtRwrMonitor::rwrDataUnsubscribeCallback ( DtSimMessage * msg,
void * usrData )
static

Static callback function for RWR data unsubscribe messages.

Parameters
msgThe simulation message containing the unsubscribe request
usrDataUser 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.

◆ processRwrDataUnsubscribe()

virtual void makVre::DtRwrMonitor::processRwrDataUnsubscribe ( DtSimMessage * msg)
virtual

Processes an RWR data unsubscribe message.

Parameters
msgThe simulation message containing the unsubscribe request

Handles unsubscription requests for RWR data, removing the client from the subscriber list.

◆ createAndSendRwrDataMessage()

virtual void makVre::DtRwrMonitor::createAndSendRwrDataMessage ( )
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.

◆ notifyTargetsChanged()

virtual void makVre::DtRwrMonitor::notifyTargetsChanged ( )
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.

◆ addToSubscriberList()

virtual void makVre::DtRwrMonitor::addToSubscriberList ( const DtSimulationAddress & add)
protectedvirtual

Adds a client to the subscriber list.

Parameters
addThe 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.

◆ removeFromSubscriberList()

virtual void makVre::DtRwrMonitor::removeFromSubscriberList ( const DtSimulationAddress & add)
protectedvirtual

Removes a client from the subscriber list.

Parameters
addThe 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.

◆ numberOfSubscribers()

virtual int makVre::DtRwrMonitor::numberOfSubscribers ( )
protectedvirtual

Gets the number of current subscribers.

Returns
The number of clients currently subscribed to this RWR's data

Returns the count of unique clients currently subscribed to receive RWR data updates.

Member Data Documentation

◆ myHostObject

DtLocalObject* makVre::DtRwrMonitor::myHostObject
protected

Pointer to the local object that owns the RWR.

The entity object that owns the RWR this monitor is associated with.

◆ myRwrContactList

const DtRwrContactInfoList* makVre::DtRwrMonitor::myRwrContactList
protected

Pointer to the RWR contact information list.

Contains the current list of radar contacts detected by the RWR system.

◆ mySubscriberListCounter

DtSubscriberListCounter makVre::DtRwrMonitor::mySubscriberListCounter
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.


The documentation for this class was generated from the following file: