VR-Engage  2.3
Loading...
Searching...
No Matches
simEventConnector.h
Go to the documentation of this file.
1/******************************************************************************
2** Copyright (c) 2025 MAK Technologies
3** All rights reserved.
4******************************************************************************/
5
6//! \file simEventConnector.h
7//! \brief Defines the base DtSimEventConnector class for VREngage simulation events
8//!
9//! This header provides the base class for all simulation event connectors in the
10//! VREngage framework. The DtSimEventConnector serves as the foundation for more
11//! specialized connectors that handle specific simulation events.
12
13#pragma once
14
17
18#if defined(DtDIS)
19 #include <vrvDis/DtDisDriver.h>
20#elif defined(DtHLA)
21 #if defined(DtHLA_1516)
22 #if defined(DtHLA_4)
23 #include <vrvHla4/DtHla4Driver.h>
24 #elif defined(DtHLA_1516_EVOLVED)
25 #include <vrvHla1516e/DtHla1516eDriver.h>
26 #else
27 #include <vrvHla1516/DtHla1516Driver.h>
28 #endif
29 #else
30 #include <vrvHla13/DtHla13Driver.h>
31 #endif
32#endif
33
34#include <vrvVrl/DtVrlinkConnection.h>
35
36namespace makVre
37{
38//! \brief Forward declaration of the player station application
40
42{
43//! \brief Base class for all simulation event connectors in VREngage
44//!
45//! DtSimEventConnector provides the core functionality for connecting
46//! VREngage components to simulation events from VR-Link. It serves as the base
47//! class for more specialized connectors that handle specific event types like
48//! entity updates, weapon fire, laser designators, etc.
49//!
50//! The connector is protocol-specific, with behavior determined by the
51//! DT_PROTOCOL_NAMESPACE macro (DIS, HLA 1.3, HLA 1516, or HLA 1516e).
53{
54public:
55 //! \brief Default constructor
56 //!
57 //! Initializes member variables and sets the connector type based on
58 //! the current protocol (DIS, HLA 1.3, HLA 1516, or HLA 1516e)
60
61 //! \brief Virtual destructor
62 virtual ~DtSimEventConnector() override;
63
64 //! \brief Installs the connector with a VR-Link connection.
65 //!
66 //! \param connection Non-owning pointer to the protocol-specific VR-Link connection.
67 //!
68 //! This method stores the connection pointer for later use. Derived classes
69 //! obtain shared application state from the global App attribute tree, perform
70 //! any additional setup, and call this base implementation first.
71 virtual void install(makVrv::DT_PROTOCOL_NAMESPACE::DtVrlinkConnection* connection);
72
73 //! \brief Performs periodic processing
74 //!
75 //! This method is called periodically to allow the connector to perform
76 //! any regular processing tasks. The default implementation does nothing.
77 //! Derived classes should override this method if they need to perform
78 //! periodic processing.
79 //!
80 //! \param dt The elapsed time in seconds since the last tick
81 virtual void tick(double dt) {}
82
83 //! \brief Shuts down the connector
84 //!
85 //! This method is called when the connector is being shut down. The default
86 //! implementation does nothing. Derived classes should override this method
87 //! to perform any necessary cleanup, such as disconnecting signals.
88 virtual void shutdown();
89
90protected:
91 //! \brief Pointer to the protocol-specific VR-Link connection
92 //!
93 //! This is set in the install() method and provides access to the
94 //! simulation networking services.
95 makVrv::DT_PROTOCOL_NAMESPACE::DtVrlinkConnection* myConnection;
96};
97} // namespace DT_PROTOCOL_NAMESPACE
98} // namespace makVre
virtual void install(makVrv::DT_PROTOCOL_NAMESPACE::DtVrlinkConnection *connection)
Installs the connector with a VR-Link connection.
virtual void tick(double dt)
Performs periodic processing.
Definition simEventConnector.h:81
makVrv::DT_PROTOCOL_NAMESPACE::DtVrlinkConnection * myConnection
Pointer to the protocol-specific VR-Link connection.
Definition simEventConnector.h:95
virtual ~DtSimEventConnector() override
Virtual destructor.
virtual void shutdown()
Shuts down the connector.
DtConnector()
Constructor.
Top-level class representing the VR-Engage application.
Definition playerStationApp.h:155
Defines the DtConnector base class for simulation protocol connections.
Defines export macros and protocol namespace for vrePlayerStationConnector.
#define VRL_DLL
Empty definition for non-Windows platforms.
Definition export.h:52
Definition connectorAccessory.h:70
!
Definition glsVreMessageUtil.h:50