VR-Engage  2.2
Loading...
Searching...
No Matches
rfxSystemMessage.h
Go to the documentation of this file.
1// ******************************************************************************
2// ** Copyright (c) 2025 MAK Technologies
3// ** All rights reserved.
4// ******************************************************************************
5
6//! \file rfxSystemMessage.h
7//! \brief Defines system-level messages for the RadarFX client-server communication
8//! \ingroup vreRadarFxShared
9//!
10//! This file contains system-level message classes used for connection management
11//! and server status monitoring, such as heartbeat messages to verify connectivity.
12
13#pragma once
14
15#include "export.h"
16#include "rfxMessage.h"
17
18#include <matrix/vlVector.h>
19
20#include <string>
21
22namespace makRadarFx
23{
24//! \brief Heartbeat message for connection monitoring
25//!
26//! This message is sent periodically between the client and server to ensure that
27//! the connection is still active. It contains no payload data and serves only
28//! as a keepalive mechanism. Both the client and server can send heartbeat messages,
29//! and both should respond to received heartbeat messages to confirm connectivity.
31{
32public:
33 //! \brief Default constructor
34 //!
35 //! Initializes a new heartbeat message with the appropriate message type
37
38 //! \brief Virtual destructor
39 //!
40 //! Cleans up any resources associated with the heartbeat message
42
43 //! \brief Gets the size of the encoded message in bytes
44 //! \return Size of the message in bytes when encoded
45 //!
46 //! Heartbeat messages have minimal size since they contain no payload data
47 virtual int messageSize();
48
49 //! \brief Decodes a byte array into a message object
50 //! \param buffer Pointer to the encoded byte array
51 //! \param length Length of the encoded byte array
52 //! \return Pointer to the newly created message object
53 //!
54 //! Static decoder function used by the message factory to create message
55 //! objects from encoded data.
56 static DtBaseMessage* decode(unsigned char* buffer, int length);
57
58 //! \brief Creates a deep copy of this message
59 //! \return Pointer to a new instance that is a copy of this message
60 //!
61 //! Creates a new message instance that is an exact copy of this message.
62 //! The caller is responsible for managing the memory of the returned object.
63 virtual DtBaseMessage* clone();
64
65protected:
66 //! \brief Serializes the message data to a stream writer
67 //! \param writer Reference to the stream writer to write the data to
68 //!
69 //! Writes the message data to the provided stream writer. For heartbeat
70 //! messages, this only writes the base message fields as there is no
71 //! additional payload data.
72 virtual void serialize(DtStreamWriter& writer);
73
74 //! \brief Deserializes message data from a stream reader
75 //! \param reader Reference to the stream reader to read the data from
76 //!
77 //! Reads the message data from the provided stream reader. For heartbeat
78 //! messages, this only reads the base message fields as there is no
79 //! additional payload data.
80 virtual void deserialize(DtStreamReader& reader);
81};
82} // namespace makRadarFx
DtBaseMessage()
Default constructor.
virtual DtBaseMessage * clone()
Creates a deep copy of this message.
virtual void serialize(DtStreamWriter &writer)
Serializes the message data to a stream writer.
virtual ~DtHeartbeatMessage()
Virtual destructor.
virtual void deserialize(DtStreamReader &reader)
Deserializes message data from a stream reader.
static DtBaseMessage * decode(unsigned char *buffer, int length)
Decodes a byte array into a message object.
DtHeartbeatMessage()
Default constructor.
virtual int messageSize()
Gets the size of the encoded message in bytes.
Stream reader for decoding values from a byte array in little endian format.
Definition byteStream.h:32
Stream writer for encoding values into a byte array in little endian format.
Definition byteStream.h:159
Defines export macros for the RadarFx Shared library.
#define RFX_DLL_SHARED
Export/import macro for non-Windows platforms (empty)
Definition export.h:25
Definition radarFxConnectorDriver.h:21
Defines the base message class for RadarFX client-server communication.