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