VR-Vantage
Loading...
Searching...
No Matches
rfxMessage.h
Go to the documentation of this file.
1// ******************************************************************************
2// ** Copyright (c) 2024 MAK Technologies, Inc.
3// ** All rights reserved.
4// ******************************************************************************
5
6
11
12
13#pragma once
14
15#include "export.h"
16#include "byteStream.h"
17#include "rfxMessageTypes.h"
18
19#include <string>
20
21namespace makRadarFx
22{
26{
27 public:
30 virtual ~DtBaseMessage();
31
33 virtual unsigned int messageType() const;
34
37 virtual unsigned char* encode();
38
40 static DtBaseMessage* decode(unsigned char* buffer, int length);
41
43 virtual int messageSize() const;
44
47 virtual DtBaseMessage* clone();
48
52 virtual void setRequestorId(const std::string& requestor);
53 virtual std::string requestorId();
54
58 virtual void setRequestId(int id);
59 virtual int requestId();
60
62 virtual std::string csvHeader() const;
63
66 virtual std::string csvString() const;
67
68 protected:
69 virtual void serialize(DtStreamWriter& writer);
70 virtual void deserialize(DtStreamReader& reader);
71
72 unsigned int myMessageType;
73 std::string myRequestorId;
75};
76}
77
Defines the stream read and writer for encoding and decoding messages from byte arrays.
virtual void setRequestorId(const std::string &requestor)
Assigns the requestor name of this message. If left at "" (default) then the DtRadarFxConnector's req...
unsigned int myMessageType
Definition rfxMessage.h:72
std::string myRequestorId
Definition rfxMessage.h:73
virtual void serialize(DtStreamWriter &writer)
virtual unsigned int messageType() const
Get the name of the message type.
static DtBaseMessage * decode(unsigned char *buffer, int length)
this function needs to be in each derived class for decoding
virtual void setRequestId(int id)
Assigns the request id of this message. If left at 0 (default) then the DtRadarFxConnector's nextId()...
virtual void deserialize(DtStreamReader &reader)
virtual int messageSize() const
Get the size of the message data in bytes.
virtual DtBaseMessage * clone()
clones this message. Caller of function is responsible for managing memory
virtual std::string requestorId()
virtual std::string csvString() const
Return a CSV string representation of this RadarFx message The string expresses all the values in the...
int myRequestId
Definition rfxMessage.h:74
virtual unsigned char * encode()
Encode the message as an array of bytes and return the bytes the receiver is responsible for calling ...
DtBaseMessage(unsigned int messageType)
CTOR/DTOR.
virtual std::string csvHeader() const
Return a string representation of the CSV header for this message.
Instances of DtStreamReader decode values from a byte array this assumes the data in the byte stream ...
Definition byteStream.h:28
Instances of DtStreamWriter encode values into a byte array this writes the data to the stream in lit...
Definition byteStream.h:75
#define RFX_DLL_SHARED
Definition include/radarFxShared/export.h:15
Definition radarFxConnector.h:28
Defines the IDs for RadarFX message types.