VR-Engage  2.3
Loading...
Searching...
No Matches
ifUnassignRolePlayer.h
Go to the documentation of this file.
1/*******************************************************************************
2** Copyright (c) 2025 MAK Technologies
3** All rights reserved.
4*******************************************************************************/
5
6//! \file ifUnassignRolePlayer.h
7//! \ingroup vreVrfMessages
8//! \brief Interface message class for unassigning role players from entities
9//!
10//! This file defines the DtIfUnassignRolePlayer class, which is used to unassign
11//! a player from an entity at a particular VREngage station.
12
13#pragma once
14
16#include <vrfExtProtocol/simInterfaceContent.h>
17#include <vlutil/vlString.h>
18#include <vrfutil/uuid.h>
19
20//! \brief Current version of the unassign role player message
22
23//! \brief Interface message for unassigning role players from entities
24//!
25//! Instances of DtIfUnassignRolePlayer messages are sent out by a VRF GUI
26//! application to unassign a player from an entity at a particular VREngage station.
27//! This message includes information about the player's VREngage application ID and
28//! the entity that will no longer be controlled.
29
30class VRFMESSAGES_DLL DtIfUnassignRolePlayer : public DtSimInterfaceContent
31{
32public:
33 //! \brief Default constructor
34 //!
35 //! Initializes an empty unassign role player message.
37
38 //! \brief Virtual destructor
39 virtual ~DtIfUnassignRolePlayer() override;
40
41 //! \brief Copy constructor
42 //! \param orig The unassign role player message to copy from
43 //!
44 //! Creates a new unassign role player message by copying an existing one.
46
47 //! \brief Assignment operator
48 //! \param orig The unassign role player message to copy from
49 //! \return Reference to this object after assignment
50 //!
51 //! Copies the contents of another unassign role player message into this one.
53
54 //! \brief Gets the interface message type
55 //! \return The message type identifier
56 //!
57 //! Returns DtUnassignRolePlayerMessageType as defined in vreVrfMessageTypes.h.
58 virtual int type() const override;
59
60 //! \brief Creates a copy of this message
61 //! \return Pointer to the new copy
62 //!
63 //! Creates a dynamically allocated copy of this message.
64 virtual DtSimInterfaceContent* clone() const override;
65
66 //! \brief Sets the identifier of the VREngage application
67 //! \param id The unique identifier to set
68 //!
69 //! Sets the unique identifier for the VREngage application.
70 //! This must be unique across all VREngage stations in an exercise
71 //! and must not change over the lifetime of the application.
72 //! The ID is the initial station-name string resolved at startup.
73 virtual void setStationId(const DtString& id);
74
75 //! \brief Gets the identifier of the VREngage application
76 //! \return The VREngage application identifier
77 virtual DtString stationId() const;
78
79 //! \brief Sets the UUID of the entity being unassigned
80 //! \param uuid The entity UUID to set
81 //!
82 //! Sets the UUID of the entity that will no longer be controlled by the VREngage station.
83 virtual void setUUID(const DtUUID& uuid);
84
85 //! \brief Gets the UUID of the entity being unassigned
86 //! \return The entity UUID
87 virtual DtUUID uuid() const;
88
89 //! \brief Gets the network representation size
90 //! \return Size in bytes of the network representation
91 //!
92 //! Returns the size of the network buffer needed to store this message.
93 virtual int netRepSize() const override;
94
95 //! \brief Deserializes the message from a network buffer
96 //! \param contentBuffer Pointer to the network buffer
97 //! \param contentSize Size of the buffer in bytes
98 //! \return True if deserialization was successful
99 //!
100 //! Fills the message from the provided network buffer.
101 virtual bool setFromNet(const char* contentBuffer, unsigned contentSize) override;
102
103 //! \brief Serializes the message for network transmission
104 //! \return True if serialization was successful
105 //!
106 //! Prepares the message for network transmission.
107 virtual bool setToNet() override;
108
109 //! \brief Formats the message data as a string
110 //! \param str String to store the formatted message data
111 //!
112 //! Appends a human-readable representation of the message to the provided string.
113 virtual void printDataToString(DtString& str) override;
114
115 //! \brief Static creator function for factory registration
116 //! \return Pointer to a new instance of DtIfUnassignRolePlayer
117 //!
118 //! This static function is used for registration with DtInterfaceContentFactory.
119 static DtSimInterfaceContent* creator();
120
121
122protected:
123 //! \brief Version information for the message
124 //!
125 //! The high word is a signal that the version exists, and the
126 //! low word is the actual version. If this information does not exist,
127 //! it is assumed to be an older status message.
129
130 //! \brief Unique identifier for the VREngage application
131 //!
132 //! Must be unique across all VREngage stations in an exercise
133 //! and must not change over the lifetime of the application.
134 //! Stored as the initial station-name string resolved at startup.
135 DtString myStationId;
136
137 //! \brief UUID of the entity being unassigned
138 //!
139 //! This is the UUID of the entity that will no longer be controlled
140 //! by the VREngage station.
141 DtUUID myUUID;
142};
virtual void printDataToString(DtString &str) override
Formats the message data as a string.
DtU32 myVersion
Version information for the message.
Definition ifUnassignRolePlayer.h:128
DtUUID myUUID
UUID of the entity being unassigned.
Definition ifUnassignRolePlayer.h:141
DtIfUnassignRolePlayer & operator=(const DtIfUnassignRolePlayer &orig)
Assignment operator.
virtual DtSimInterfaceContent * clone() const override
Creates a copy of this message.
DtIfUnassignRolePlayer(const DtIfUnassignRolePlayer &orig)
Copy constructor.
DtString myStationId
Unique identifier for the VREngage application.
Definition ifUnassignRolePlayer.h:135
virtual bool setToNet() override
Serializes the message for network transmission.
virtual int type() const override
Gets the interface message type.
virtual bool setFromNet(const char *contentBuffer, unsigned contentSize) override
Deserializes the message from a network buffer.
static DtSimInterfaceContent * creator()
Static creator function for factory registration.
DtIfUnassignRolePlayer()
Default constructor.
virtual DtUUID uuid() const
Gets the UUID of the entity being unassigned.
virtual void setUUID(const DtUUID &uuid)
Sets the UUID of the entity being unassigned.
virtual ~DtIfUnassignRolePlayer() override
Virtual destructor.
virtual void setStationId(const DtString &id)
Sets the identifier of the VREngage application.
virtual int netRepSize() const override
Gets the network representation size.
virtual DtString stationId() const
Gets the identifier of the VREngage application.
const int DtUnassignRolePlayerVersion
Current version of the unassign role player message.
Definition ifUnassignRolePlayer.h:21
Export/import macros for the VRF Messages library.
#define VRFMESSAGES_DLL
Definition export.h:23