VR-Engage  2.2
Loading...
Searching...
No Matches
endingSessionState.h
Go to the documentation of this file.
1/******************************************************************************
2** Copyright (c) 2025 MAK Technologies
3** All rights reserved.
4******************************************************************************/
5
6//! \file endingSessionState.h
7//! \brief Defines the state for cleanly terminating a simulation session
8//!
9//! This file contains the DtEndingSessionState class which manages the application
10//! state when a simulation session is being terminated. It handles the orderly
11//! shutdown of session resources, network connections, and UI transitions required
12//! when exiting a session.
13
14#pragma once
15
17
20
21// #include <memory>
22
23namespace makVre
24{
25//! \brief Forward declaration of the session load data message class
27
28//! \brief Application state for terminating a simulation session
29//!
30//! DtEndingSessionState represents the application state when VR-Engage
31//! is in the process of terminating a simulation session. It manages the
32//! orderly shutdown of session resources, sending appropriate disconnect
33//! messages to network peers, and transitioning to the appropriate next state
34//! once the session has been fully terminated.
36{
37public:
38 //! \brief Constructor
39 //! \param app Reference to the player station application
40 //!
41 //! Creates a new ending session state associated with the given application.
42 //! This state is entered when a session is being terminated, either by user
43 //! request or due to network disconnection.
45
46 //! \brief Virtual destructor
47 //!
48 //! Ensures proper cleanup of resources used by the ending session state.
49 virtual ~DtEndingSessionState() override;
50
51 //! \brief Called when the state is entered
52 //! \param args Pointer to arguments from the previous state
53 //!
54 //! Initializes the session termination process, sends disconnect notifications
55 //! to network peers, and begins cleanup of session resources. Takes session
56 //! information from the previous state's arguments if available.
57 virtual void onEnter(const DtPlayerStationStateArgs* args) override;
58
59 //! \brief Called when the state is exited
60 //!
61 //! Completes final cleanup of any remaining session resources and prepares
62 //! the application for the next state. This is called after session
63 //! termination is complete.
64 virtual void onExit() override;
65
66 //! \brief Updates the state each frame
67 //! \param dt Time in seconds since the last update
68 //!
69 //! Monitors the progress of session termination processes, updates UI
70 //! elements with status information, and transitions to the next state
71 //! when termination is complete.
72 virtual void tick(double dt) override;
73
74protected:
75 //! \brief Handles session status messages
76 //! \param msg Pointer to the session status message
77 //! \return Message handling result
78 //!
79 //! Processes notifications about changes to the VRF session status,
80 //! updating the termination process based on current session state.
81 //! This is particularly important for monitoring when disconnection
82 //! from the session is complete.
84};
85
86} // namespace makVre
virtual DtVreMessageResult handleVrfSessionStatus(DtVreMessage *msg)
Handles session status messages.
DtEndingSessionState(DtPlayerStationApp &app)
Constructor.
virtual void tick(double dt) override
Updates the state each frame.
virtual void onEnter(const DtPlayerStationStateArgs *args) override
Called when the state is entered.
virtual ~DtEndingSessionState() override
Virtual destructor.
virtual void onExit() override
Called when the state is exited.
Top-level class representing the VR-Engage application.
Definition playerStationApp.h:163
Class for passing arguments during state transitions.
Definition playerStationState.h:45
DtPlayerStationApp & app() const
Gets a reference to the player station application.
DtPlayerStationState(DtPlayerStationApp &app, std::string stateType)
Constructor.
Abstract base class for all VREngage messages.
Definition vreMessage.h:50
Definition sessionLoadData.h:29
Defines export macros for the VR-Engage Player Station library.
#define PLAYERSTATION_DLL
Definition export.h:24
Include export definitions for this library.
Definition glsVreMessageUtil.h:49
DtVreMessageResult
Enumeration of possible message handling results.
Definition vreMessage.h:33
Defines base classes for the VR-Engage state management system.
Defines the base class for all VREngage messages.