VR-Engage  2.2
Loading...
Searching...
No Matches
vreConnectionInformation.h
Go to the documentation of this file.
1/******************************************************************************
2** Copyright (c) 2025 MAK Technologies, Inc.
3** All rights reserved.
4******************************************************************************/
5
6//! \file vreConnectionInformation.h
7//! \ingroup vrePlayerStation.dll
8//! \brief Contains the DtVreConnectionInformation class for managing VR-Link connections and their settings
9
10#pragma once
11
12#ifndef DT_PROTOCOL_NAMESPACE
13 #error Namespace Protocol Macro DT_PROTOCOL_NAMESPACE not defined.
14#endif
15
16
18#include <vrvUtil/DtVirtualBaseClass.h>
20
21namespace makVrv
22{
23class DtDriver;
24class DtDe;
25} // namespace makVrv
26
27namespace makVre
28{
30{
31//! \brief This class manages connection information for simulation drivers
32//!
33//! DtVreConnectionInformation handles the configuration, creation, and management of
34//! simulation connection drivers (HLA, DIS). It processes connection requests,
35//! manages connection settings, and handles messages related to connection status.
36class VRL_DLL DtVreConnectionInformation : public makVrv::DtVirtualBaseClass
37{
38public:
39 //! \brief Constructor for connection information manager
40 //! \param de Reference to the distributed environment to use
42
43 //! \brief Virtual destructor
44 //!
45 //! Disconnects from signal handlers and removes message handlers
46 virtual ~DtVreConnectionInformation() override;
47
48 //! \brief Gets or creates a singleton instance of DtVreConnectionInformation
49 //! \param de Reference to the distributed environment
50 //! \return Reference to the singleton instance
51 //!
52 //! If an instance doesn't exist, one will be created and registered with the DE
53 static DtVreConnectionInformation& instance(makVrv::DtDe& de);
54
55 //! \brief Registers an instance with the distributed environment
56 //! \param de Reference to the distributed environment
57 //! \param instance Pointer to the instance to register
59
60 //! \brief Factory method to create a new connection information manager
61 //! \param de Reference to the distributed environment to use
62 //! \return Pointer to a newly created DtVreConnectionInformation
63 static DtVreConnectionInformation* creator(makVrv::DtDe& de);
64
65 //! \brief Initializes message handlers after DE initialization
66 //!
67 //! Registers message handlers for connection information requests, updates, and stops
68 virtual void postInit();
69
70 //! \brief Callback invoked when a driver is created
71 //! \param con Reference to the newly created driver
72 virtual void onDriverCreated(makVrv::DtDriver& con);
73
74 //! \brief Callback invoked just before auto-drivers are loaded
76
77protected:
78 //! \brief Handles requests for connection information
79 //! \param msg Pointer to the message containing the request
80 //! \return Message result indicating success or failure
81 //!
82 //! Processes requests for connection configuration information
83 //! and responds with current connection settings
85
86 //! \brief Handles messages to set connection information
87 //! \param msg Pointer to the message containing the settings to apply
88 //! \return Message result indicating success or failure
89 //!
90 //! Applies connection settings from the message to the driver,
91 //! creates new drivers if necessary, and saves settings to file
93
94 //! \brief Handles messages about connection updates
95 //! \param msg Pointer to the message containing update information
96 //! \return Message result indicating success or failure
97 //!
98 //! Updates connection settings for existing drivers
100
101 //! \brief Handles messages to stop a connection
102 //! \param msg Pointer to the message requesting connection stop
103 //! \return Message result indicating success or failure
104 //!
105 //! Processes requests to stop a driver and disconnects it
107
108protected:
109 //! \brief Reference to the distributed environment
110 makVrv::DtDe& myDe;
111
112 //! \brief Protocol-specific driver name, determined at compile time
113 //!
114 //! This is set to "Dis", "Hla13", "Hla1516", or "Hla1516e" depending on
115 //! which protocol is being compiled
116 static const std::string theDriverName;
117};
118} // namespace DT_PROTOCOL_NAMESPACE
119} // namespace makVre
static void registerInstance(makVrv::DtDe &de, DtVreConnectionInformation *instance)
Registers an instance with the distributed environment.
virtual makVre::DtVreMessageResult handleConnectionInfoRequest(makVre::DtVreMessage *msg)
Handles requests for connection information.
static const std::string theDriverName
Protocol-specific driver name, determined at compile time.
Definition vreConnectionInformation.h:116
virtual void onDriverCreated(makVrv::DtDriver &con)
Callback invoked when a driver is created.
makVrv::DtDe & myDe
Reference to the distributed environment.
Definition vreConnectionInformation.h:110
virtual void onAutoDriversAboutToBeLoaded()
Callback invoked just before auto-drivers are loaded.
static DtVreConnectionInformation * creator(makVrv::DtDe &de)
Factory method to create a new connection information manager.
virtual makVre::DtVreMessageResult handleConnectionInfoSet(makVre::DtVreMessage *msg)
Handles messages to set connection information.
DtVreConnectionInformation(makVrv::DtDe &de)
Constructor for connection information manager.
virtual makVre::DtVreMessageResult handleConnectionUpdated(makVre::DtVreMessage *msg)
Handles messages about connection updates.
static DtVreConnectionInformation & instance(makVrv::DtDe &de)
Gets or creates a singleton instance of DtVreConnectionInformation.
virtual makVre::DtVreMessageResult handleStopConnection(makVre::DtVreMessage *msg)
Handles messages to stop a connection.
virtual ~DtVreConnectionInformation() override
Virtual destructor.
virtual void postInit()
Initializes message handlers after DE initialization.
Abstract base class for all VREngage messages.
Definition vreMessage.h:50
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
DtVreMessageResult
Enumeration of possible message handling results.
Definition vreMessage.h:33
Definition appLauncherComponent.h:28
makVrv::DtDe * de()
Gets the display element pointer used by the plugin.
Defines the base class for all VREngage messages.