VR-Engage  2.2
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
18
19#if defined(DtDIS)
20 #include <vrvDis/DtDisDriver.h>
21#elif defined(DtHLA)
22 #if defined(DtHLA_1516)
23 #if defined(DtHLA_4)
24 #include <vrvHla4/DtHla4Driver.h>
25 #elif defined(DtHLA_1516_EVOLVED)
26 #include <vrvHla1516e/DtHla1516eDriver.h>
27 #else
28 #include <vrvHla1516/DtHla1516Driver.h>
29 #endif
30 #else
31 #include <vrvHla13/DtHla13Driver.h>
32 #endif
33#endif
34
35#include <vrvVrl/DtVrlinkConnection.h>
36
37namespace makVre
38{
39//! \brief Forward declaration of the player station application
41
43{
44//! \brief Base class for all simulation event connectors in VREngage
45//!
46//! DtSimEventConnector provides the core functionality for connecting
47//! VREngage components to simulation events from VR-Link. It serves as the base
48//! class for more specialized connectors that handle specific event types like
49//! entity updates, weapon fire, laser designators, etc.
50//!
51//! The connector is protocol-specific, with behavior determined by the
52//! DT_PROTOCOL_NAMESPACE macro (DIS, HLA 1.3, HLA 1516, or HLA 1516e).
54{
55public:
56 //! \brief Default constructor
57 //!
58 //! Initializes member variables and sets the connector type based on
59 //! the current protocol (DIS, HLA 1.3, HLA 1516, or HLA 1516e)
61
62 //! \brief Virtual destructor
63 virtual ~DtSimEventConnector() override;
64
65 //! \brief Installs the connector with the application and connection
66 //! \param app Pointer to the player station application
67 //! \param connection Pointer to the protocol-specific VR-Link connection
68 //!
69 //! This method stores the application and connection pointers for later use.
70 //! Derived classes should override this method to perform additional setup,
71 //! but should call the base class implementation first.
72 virtual void install(DtPlayerStationApp* app, makVrv::DT_PROTOCOL_NAMESPACE::DtVrlinkConnection* connection);
73
74 //! \brief Performs periodic processing
75 //!
76 //! This method is called periodically to allow the connector to perform
77 //! any regular processing tasks. The default implementation does nothing.
78 //! Derived classes should override this method if they need to perform
79 //! periodic processing.
80 virtual void tick() {}
81
82 //! \brief Shuts down the connector
83 //!
84 //! This method is called when the connector is being shut down. The default
85 //! implementation does nothing. Derived classes should override this method
86 //! to perform any necessary cleanup, such as disconnecting signals.
87 virtual void shutdown() {}
88
89protected:
90 //! \brief Pointer to the player station application
91 //!
92 //! This is set in the install() method and provides access to the
93 //! VREngage application services.
95
96 //! \brief Pointer to the protocol-specific VR-Link connection
97 //!
98 //! This is set in the install() method and provides access to the
99 //! simulation networking services.
100 makVrv::DT_PROTOCOL_NAMESPACE::DtVrlinkConnection* myConnection;
101};
102} // namespace DT_PROTOCOL_NAMESPACE
103} // namespace makVre
makVrv::DT_PROTOCOL_NAMESPACE::DtVrlinkConnection * myConnection
Pointer to the protocol-specific VR-Link connection.
Definition simEventConnector.h:100
virtual ~DtSimEventConnector() override
Virtual destructor.
virtual void shutdown()
Shuts down the connector.
Definition simEventConnector.h:87
DtPlayerStationApp * myApp
Pointer to the player station application.
Definition simEventConnector.h:94
virtual void install(DtPlayerStationApp *app, makVrv::DT_PROTOCOL_NAMESPACE::DtVrlinkConnection *connection)
Installs the connector with the application and connection.
virtual void tick()
Performs periodic processing.
Definition simEventConnector.h:80
DtConnector()
Constructor.
Top-level class representing the VR-Engage application.
Definition playerStationApp.h:163
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:58
Include export definitions for this library.
Definition glsVreMessageUtil.h:49
Defines the base class for all VREngage messages.