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

Detailed Description

DtRadarStateMonitor manages the communication of radar state information between a radar system and visualization systems. It handles subscription requests from clients, maintains a list of current subscribers, and sends radar state messages when the radar state changes.

#include <radarStateMonitor.h>

Public Member Functions

 DtRadarStateMonitor (DtLocalObject *hostObject, const DtRwRadarStateInfo *contactInfoList)
 
virtual ~DtRadarStateMonitor ()
 
virtual bool init ()
 
virtual void setRadarName (const DtString &val)
 
virtual DtString radarName () const
 
virtual void registerMessageCallbacks ()
 
virtual void processRadarStateRequest (DtSimMessage *msg)
 
virtual void processRadarStateUnsubscribe (DtSimMessage *msg)
 
virtual void createAndSendRadarStateMessage ()
 
virtual void notifyRadarStateChanged ()
 

Static Public Member Functions

static void radarStateRequestCallback (DtSimMessage *msg, void *usrData)
 
static void radarStateUnsubscribeCallback (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
 
DtString myRadarName
 
const DtRwRadarStateInfomyRadarStateInfo
 
DtSubscriberListCounter mySubscriberList
 

Private Member Functions

 DtRadarStateMonitor ()
 
 DtRadarStateMonitor (const DtRadarStateMonitor &orig)
 
const DtRadarStateMonitoroperator= (const DtRadarStateMonitor &orig)
 

Member Typedef Documentation

◆ DtSubscriberListCounter

using makVre::DtRadarStateMonitor::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

◆ DtRadarStateMonitor() [1/3]

makVre::DtRadarStateMonitor::DtRadarStateMonitor ( )
private

Default constructor (not implemented)

Default constructor is private and not implemented to prevent creation of instances without proper initialization.

Referenced by DtRadarStateMonitor(), and operator=().

◆ DtRadarStateMonitor() [2/3]

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

Copy constructor (not implemented)

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

References DtRadarStateMonitor().

◆ DtRadarStateMonitor() [3/3]

makVre::DtRadarStateMonitor::DtRadarStateMonitor ( DtLocalObject * hostObject,
const DtRwRadarStateInfo * contactInfoList )

Constructor.

Parameters
hostObjectThe local object that owns the radar this monitor is for
contactInfoListPointer to the radar state information maintained by the radar

Creates a new radar state monitor that will handle communication between the specified radar system and visualization clients.

◆ ~DtRadarStateMonitor()

virtual makVre::DtRadarStateMonitor::~DtRadarStateMonitor ( )
virtual

Virtual destructor.

Cleans up resources used by the radar state monitor.

Member Function Documentation

◆ operator=()

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

Assignment operator (not implemented)

Returns
Reference to this object

Assignment operator is private and not implemented to prevent assignment.

References DtRadarStateMonitor().

◆ init()

virtual bool makVre::DtRadarStateMonitor::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.

◆ setRadarName()

virtual void makVre::DtRadarStateMonitor::setRadarName ( const DtString & val)
virtual

Sets the radar name.

Parameters
valThe name to set for the radar

Sets the name identifier for the radar being monitored.

◆ radarName()

virtual DtString makVre::DtRadarStateMonitor::radarName ( ) const
virtual

Gets the radar name.

Returns
The name of the radar being monitored

Retrieves the name identifier for the radar being monitored.

◆ registerMessageCallbacks()

virtual void makVre::DtRadarStateMonitor::registerMessageCallbacks ( )
virtual

Registers message callbacks for radar state requests.

Registers callback functions to handle radarStateRequest and radarStateUnsubscribe messages from visualization clients.

◆ radarStateRequestCallback()

static void makVre::DtRadarStateMonitor::radarStateRequestCallback ( DtSimMessage * msg,
void * usrData )
static

Static callback function for radar state request messages.

Parameters
msgThe simulation message containing the request
usrDataUser data pointer (contains the monitor instance)

Static function registered as a callback to handle radar state request messages. Forwards the request to the appropriate monitor instance.

◆ processRadarStateRequest()

virtual void makVre::DtRadarStateMonitor::processRadarStateRequest ( DtSimMessage * msg)
virtual

Processes a radar state request message.

Parameters
msgThe simulation message containing the request

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

◆ radarStateUnsubscribeCallback()

static void makVre::DtRadarStateMonitor::radarStateUnsubscribeCallback ( DtSimMessage * msg,
void * usrData )
static

Static callback function for radar state 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 radar state unsubscribe messages. Forwards the request to the appropriate monitor instance.

◆ processRadarStateUnsubscribe()

virtual void makVre::DtRadarStateMonitor::processRadarStateUnsubscribe ( DtSimMessage * msg)
virtual

Processes a radar state unsubscribe message.

Parameters
msgThe simulation message containing the unsubscribe request

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

◆ createAndSendRadarStateMessage()

virtual void makVre::DtRadarStateMonitor::createAndSendRadarStateMessage ( )
virtual

Creates and sends a radar state message to subscribers.

Constructs a DtRadarState message based on the current state of the radar system and sends it to all current subscribers. This provides visualization clients with up-to-date radar state information.

◆ notifyRadarStateChanged()

virtual void makVre::DtRadarStateMonitor::notifyRadarStateChanged ( )
virtual

Notifies that the radar state has changed.

Called by the radar system whenever its state changes. This triggers radar state messages to be sent out to all current subscribers, ensuring they have the latest state information.

◆ addToSubscriberList()

virtual void makVre::DtRadarStateMonitor::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 radar's state data. Maintains a counter for each address to support multiple subscriptions from the same client.

◆ removeFromSubscriberList()

virtual void makVre::DtRadarStateMonitor::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::DtRadarStateMonitor::numberOfSubscribers ( )
protectedvirtual

Gets the number of current subscribers.

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

Returns the count of unique clients currently subscribed to receive radar state updates.

Member Data Documentation

◆ myHostObject

DtLocalObject* makVre::DtRadarStateMonitor::myHostObject
protected

Pointer to the local object that owns the radar.

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

◆ myRadarName

DtString makVre::DtRadarStateMonitor::myRadarName
protected

Name of the radar.

String identifier for the radar being monitored.

◆ myRadarStateInfo

const DtRwRadarStateInfo* makVre::DtRadarStateMonitor::myRadarStateInfo
protected

Pointer to the radar state information.

Contains the current state information for the radar system.

◆ mySubscriberList

DtSubscriberListCounter makVre::DtRadarStateMonitor::mySubscriberList
protected

List of current subscribers with subscription counts.

Contains the simulation addresses of all clients currently subscribed to receive radar state updates, with a count of subscriptions for each.


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