refactor: Heavy refactoring of SPIT
This commit is contained in:
@@ -1,15 +1,3 @@
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
/*
|
||||
* File: Message.h
|
||||
* Author: Hagi
|
||||
*
|
||||
* Created on 3. April 2019, 08:51
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <cstdlib>
|
||||
@@ -37,8 +25,8 @@ class Message {
|
||||
int mVersion{SPITVERSION};
|
||||
unsigned char mMessageNumber{};
|
||||
int mBytesCount{BYTESLENGTH};
|
||||
string mServerID{};
|
||||
string mClientID{};
|
||||
string mServerId{};
|
||||
string mClientId{};
|
||||
int mOpFlag{-1};
|
||||
int mParseOffset{};
|
||||
|
||||
@@ -47,8 +35,8 @@ class Message {
|
||||
int getSPITVersion() const { return mVersion; }
|
||||
unsigned char getMessageNumber() const { return mMessageNumber; }
|
||||
int getBytesCount() const { return mBytesCount; }
|
||||
string getServerID() const { return mServerID; }
|
||||
string getClientID() const { return mClientID; }
|
||||
string getServerID() const { return mServerId; }
|
||||
string getClientID() const { return mClientId; }
|
||||
int getType() const { return mOpFlag; }
|
||||
|
||||
// Receive
|
||||
@@ -56,9 +44,9 @@ class Message {
|
||||
|
||||
// Send
|
||||
Header(int p_SPITVersion, int pOpFlag);
|
||||
void setMessageNumber(unsigned char p_MessageNumber) { mMessageNumber = p_MessageNumber; }
|
||||
void setServerID(string p_ID) { mServerID = p_ID; }
|
||||
void setClientID(string p_ID) { mClientID = p_ID; }
|
||||
void setMessageNumber(unsigned char messageNumber) { mMessageNumber = messageNumber; }
|
||||
void setServerID(string iD) { mServerId = iD; }
|
||||
void setClientID(string iD) { mClientId = iD; }
|
||||
void setOPFlag(int pOpFlag) { mOpFlag = pOpFlag; }
|
||||
bool fillBytes(std::vector<char> &message);
|
||||
};
|
||||
@@ -112,7 +100,7 @@ class Message {
|
||||
}
|
||||
|
||||
// Receive
|
||||
OPPart(unique_ptr<Header> p_Header, int pOpFlag, int size);
|
||||
OPPart(unique_ptr<Header> header, int pOpFlag, int size);
|
||||
void setHeader(int opFlag);
|
||||
virtual bool parse(const std::vector<char> &message) = 0;
|
||||
|
||||
@@ -145,22 +133,22 @@ class Message {
|
||||
|
||||
// Members
|
||||
private:
|
||||
unique_ptr<OPPart> m_OPPart{};
|
||||
unique_ptr<OPPart> oPPart{};
|
||||
|
||||
// Receive
|
||||
public:
|
||||
Message(std::vector<char> message);
|
||||
|
||||
const Header *getHeader() const { return m_OPPart->getHeader(); }
|
||||
const Header *getHeader() const { return oPPart->getHeader(); }
|
||||
int getType() const {
|
||||
if (!m_OPPart || !m_OPPart->getHeader()) {
|
||||
if (!oPPart || !oPPart->getHeader()) {
|
||||
return -1;
|
||||
}
|
||||
return m_OPPart->getHeader()->getType();
|
||||
return oPPart->getHeader()->getType();
|
||||
}
|
||||
const OPPart *getOPPart() const { return m_OPPart.get(); }
|
||||
const OPPart *getOPPart() const { return oPPart.get(); }
|
||||
template<typename T>
|
||||
T &getAs() const { return *reinterpret_cast<T *>(m_OPPart.get()); }
|
||||
T &getAs() const { return *reinterpret_cast<T *>(oPPart.get()); }
|
||||
|
||||
private:
|
||||
bool parse(std::vector<char> message);
|
||||
@@ -179,31 +167,31 @@ class Message {
|
||||
static constexpr int BYTESLENGTH = 304;
|
||||
|
||||
private:
|
||||
string m_ClientComputerName{};
|
||||
string m_ClientName{};
|
||||
string m_LoginName{};
|
||||
string m_LoginPassword{};
|
||||
string m_ServerIP{};
|
||||
int m_ServerPort{};
|
||||
string mClientComputerName{};
|
||||
string mClientName{};
|
||||
string mLoginName{};
|
||||
string mLoginPassword{};
|
||||
string mServerIp{};
|
||||
int mServerPort{};
|
||||
|
||||
public:
|
||||
// Receive
|
||||
Connect(unique_ptr<Header> p_Header);
|
||||
Connect(unique_ptr<Header> header);
|
||||
bool parse(const std::vector<char> &message);
|
||||
|
||||
string getClientComputerName() const { return m_ClientComputerName; }
|
||||
string getClientName() const { return m_ClientName; }
|
||||
string getLoginName() const { return m_LoginName; }
|
||||
string getLoginPassword() const { return m_LoginPassword; }
|
||||
string getServerIP() const { return m_ServerIP; }
|
||||
int getServerPort() const { return m_ServerPort; }
|
||||
string getClientComputerName() const { return mClientComputerName; }
|
||||
string getClientName() const { return mClientName; }
|
||||
string getLoginName() const { return mLoginName; }
|
||||
string getLoginPassword() const { return mLoginPassword; }
|
||||
string getServerIP() const { return mServerIp; }
|
||||
int getServerPort() const { return mServerPort; }
|
||||
|
||||
// Send
|
||||
Connect(string p_ComputerName, string p_ClientName);
|
||||
|
||||
void setLoginName(string p_LoginName) { m_LoginName = p_LoginName; }
|
||||
void setLoginPassword(string p_LoginPassword) { m_LoginPassword = p_LoginPassword; }
|
||||
void setServerIP(string p_ServerIP) { m_ServerIP = p_ServerIP; }
|
||||
void setLoginName(string p_LoginName) { mLoginName = p_LoginName; }
|
||||
void setLoginPassword(string p_LoginPassword) { mLoginPassword = p_LoginPassword; }
|
||||
void setServerIP(string p_ServerIP) { mServerIp = p_ServerIP; }
|
||||
void setServerPort(int p_ServerPort);
|
||||
bool fillBytes(std::vector<char> &message);
|
||||
};
|
||||
@@ -216,28 +204,28 @@ class Message {
|
||||
static constexpr int BYTESLENGTH = 137;
|
||||
|
||||
private:
|
||||
string m_ServerComputerName{};
|
||||
string m_ServerName{};
|
||||
bool m_Connected{};
|
||||
int m_StepTime{40}; // ms step size the Server will send play sequences
|
||||
string mServerComputerName{};
|
||||
string mServerName{};
|
||||
bool mConnected{};
|
||||
int mStepTime{40}; // ms step size the Server will send play sequences
|
||||
|
||||
public:
|
||||
ConnectAnswer(const ConnectAnswer &orig);
|
||||
// Receive
|
||||
ConnectAnswer(unique_ptr<Header> p_Header);
|
||||
ConnectAnswer(unique_ptr<Header> header);
|
||||
|
||||
bool parse(const std::vector<char> &message);
|
||||
|
||||
const string getServerComputerName() const { return m_ServerComputerName; }
|
||||
const string getServerName() const { return m_ServerName; }
|
||||
bool getConnected() const { return m_Connected; }
|
||||
int getStepTime() const { return m_StepTime; }
|
||||
const string getServerComputerName() const { return mServerComputerName; }
|
||||
const string getServerName() const { return mServerName; }
|
||||
bool getConnected() const { return mConnected; }
|
||||
int getStepTime() const { return mStepTime; }
|
||||
|
||||
// Send
|
||||
ConnectAnswer();
|
||||
void setServerComputerName(string p_ServerComputerName) { m_ServerComputerName = p_ServerComputerName; }
|
||||
void setServerName(string p_ServerName) { m_ServerName = p_ServerName; }
|
||||
void setConnected(bool p_Connected) { m_Connected = p_Connected; }
|
||||
void setServerComputerName(string p_ServerComputerName) { mServerComputerName = p_ServerComputerName; }
|
||||
void setServerName(string p_ServerName) { mServerName = p_ServerName; }
|
||||
void setConnected(bool p_Connected) { mConnected = p_Connected; }
|
||||
void setStepTime(int p_StepTime_ms);
|
||||
bool fillBytes(std::vector<char> &message);
|
||||
};
|
||||
@@ -251,7 +239,7 @@ class Message {
|
||||
|
||||
Disconnect(const Disconnect &orig);
|
||||
// Receive
|
||||
Disconnect(unique_ptr<Header> p_Header);
|
||||
Disconnect(unique_ptr<Header> header);
|
||||
bool parse(const std::vector<char> &message);
|
||||
|
||||
// Send
|
||||
@@ -268,7 +256,7 @@ class Message {
|
||||
|
||||
Watchdog(const Watchdog &orig);
|
||||
// Receive
|
||||
Watchdog(unique_ptr<Header> p_Header);
|
||||
Watchdog(unique_ptr<Header> header);
|
||||
bool parse(const std::vector<char> &message);
|
||||
|
||||
// Send
|
||||
@@ -285,7 +273,7 @@ class Message {
|
||||
|
||||
// Receive
|
||||
WatchdogAnswer(const WatchdogAnswer &orig);
|
||||
WatchdogAnswer(unique_ptr<Header> p_Header);
|
||||
WatchdogAnswer(unique_ptr<Header> header);
|
||||
bool parse(const std::vector<char> &message);
|
||||
|
||||
// Send
|
||||
@@ -303,22 +291,22 @@ class Message {
|
||||
static constexpr int BYTESLENGTH = 113;
|
||||
|
||||
private:
|
||||
string m_ProjectID{};
|
||||
string m_ProjectName{};
|
||||
int m_FramesPerSecond{1000}; // Frames per second
|
||||
string mProjectID{};
|
||||
string mProjectName{};
|
||||
int mFramesPerSecond{1000}; // Frames per second
|
||||
|
||||
// Receive
|
||||
public:
|
||||
ReportProject(const ReportProject &orig);
|
||||
ReportProject(unique_ptr<Header> p_Header);
|
||||
ReportProject(unique_ptr<Header> header);
|
||||
bool parse(const std::vector<char> &message);
|
||||
const string getProjectID() const { return m_ProjectID; }
|
||||
const string getProjectName() const { return m_ProjectName; }
|
||||
int getFramesPerSecond() const { return m_FramesPerSecond; }
|
||||
const string getProjectID() const { return mProjectID; }
|
||||
const string getProjectName() const { return mProjectName; }
|
||||
int getFramesPerSecond() const { return mFramesPerSecond; }
|
||||
// Send
|
||||
ReportProject(string p_ProjectID, string p_ProjectName);
|
||||
|
||||
void setFramesPerSecond(const int p_FramesPerSecond) { m_FramesPerSecond = p_FramesPerSecond; }
|
||||
void setFramesPerSecond(const int p_FramesPerSecond) { mFramesPerSecond = p_FramesPerSecond; }
|
||||
bool fillBytes(std::vector<char> &message);
|
||||
};
|
||||
|
||||
@@ -330,15 +318,15 @@ class Message {
|
||||
static constexpr int BYTESLENGTH = 45;
|
||||
|
||||
private:
|
||||
string m_ProjectID{};
|
||||
string mProjectID{};
|
||||
|
||||
public:
|
||||
CloseProject(const CloseProject &orig);
|
||||
// Receive
|
||||
CloseProject(unique_ptr<Header> p_Header);
|
||||
CloseProject(unique_ptr<Header> header);
|
||||
bool parse(const std::vector<char> &message);
|
||||
const string getProjectID() const {
|
||||
return m_ProjectID;
|
||||
return mProjectID;
|
||||
}
|
||||
// Send
|
||||
CloseProject(string projectID);
|
||||
@@ -353,7 +341,7 @@ class Message {
|
||||
|
||||
RequestProjectTransfer(const RequestProjectTransfer &orig);
|
||||
// Receive
|
||||
RequestProjectTransfer(unique_ptr<Header> p_Header);
|
||||
RequestProjectTransfer(unique_ptr<Header> header);
|
||||
bool parse(const std::vector<char> &message);
|
||||
// Send
|
||||
RequestProjectTransfer();
|
||||
@@ -369,7 +357,7 @@ class Message {
|
||||
|
||||
StartProjectTransfer(const StartProjectTransfer &orig);
|
||||
// Receive
|
||||
StartProjectTransfer(unique_ptr<Header> p_Header);
|
||||
StartProjectTransfer(unique_ptr<Header> header);
|
||||
bool parse(const std::vector<char> &message);
|
||||
// Send
|
||||
StartProjectTransfer();
|
||||
@@ -384,7 +372,7 @@ class Message {
|
||||
|
||||
EndProjectTransfer(const EndProjectTransfer &orig);
|
||||
// Receive
|
||||
EndProjectTransfer(unique_ptr<Header> p_Header);
|
||||
EndProjectTransfer(unique_ptr<Header> header);
|
||||
bool parse(const std::vector<char> &message);
|
||||
// Send
|
||||
EndProjectTransfer();
|
||||
@@ -400,43 +388,43 @@ class Message {
|
||||
static constexpr int BYTESLENGTH = 168;
|
||||
|
||||
private:
|
||||
bool m_Confirmed{};
|
||||
string m_SPITTypeID{};
|
||||
bool m_Fixed{};
|
||||
bool m_ServerRemote{};
|
||||
bool m_ServerProjectIndepended{};
|
||||
string m_SPITTypeGroupName{};
|
||||
string m_SPITTypeName{};
|
||||
uint64_t m_Delay{};
|
||||
uint64_t m_Duration{};
|
||||
bool mConfirmed{};
|
||||
string mSPITTypeID{};
|
||||
bool mFixed{};
|
||||
bool mServerRemote{};
|
||||
bool mServerProjectIndepended{};
|
||||
string mTypeGroupName{};
|
||||
string mSPITTypeName{};
|
||||
uint64_t mDelay{};
|
||||
uint64_t mDuration{};
|
||||
|
||||
public:
|
||||
ReportType(const ReportType &orig);
|
||||
// Receive
|
||||
ReportType(unique_ptr<Header> p_Header);
|
||||
ReportType(unique_ptr<Header> header);
|
||||
bool parse(const std::vector<char> &message);
|
||||
|
||||
bool getConfirmed() const { return m_Confirmed; }
|
||||
const string getID() const { return m_SPITTypeID; }
|
||||
bool getFixed() const { return m_Fixed; }
|
||||
bool getServerRemote() const { return m_ServerRemote; }
|
||||
bool getServerProjectIndepended() const { return m_ServerProjectIndepended; }
|
||||
const string getGroupName() const { return m_SPITTypeGroupName; }
|
||||
const string getName() const { return m_SPITTypeName; }
|
||||
uint64_t getDelay() const { return m_Delay; }
|
||||
uint64_t getDuration() const { return m_Duration; }
|
||||
bool getConfirmed() const { return mConfirmed; }
|
||||
const string getID() const { return mSPITTypeID; }
|
||||
bool getFixed() const { return mFixed; }
|
||||
bool getServerRemote() const { return mServerRemote; }
|
||||
bool getServerProjectIndepended() const { return mServerProjectIndepended; }
|
||||
const string getGroupName() const { return mTypeGroupName; }
|
||||
const string getName() const { return mSPITTypeName; }
|
||||
uint64_t getDelay() const { return mDelay; }
|
||||
uint64_t getDuration() const { return mDuration; }
|
||||
// Send
|
||||
|
||||
ReportType();
|
||||
void setConfirmed(bool p_Confirmed) { m_Confirmed = p_Confirmed; }
|
||||
void setID(string p_ID) { m_SPITTypeID = p_ID; }
|
||||
void setFixed(bool p_Fixed) { m_Fixed = p_Fixed; }
|
||||
void setServerRemote(bool p_IsServerRemote) { m_ServerRemote = p_IsServerRemote; }
|
||||
void setServerProjectIndepended(bool p_ProjectIndpended) { m_ServerProjectIndepended = p_ProjectIndpended; }
|
||||
void setGroupName(string p_GroupName) { m_SPITTypeGroupName = p_GroupName; }
|
||||
void setName(string p_Name) { m_SPITTypeName = p_Name; }
|
||||
void setDelay(uint64_t p_Delay) { m_Delay = p_Delay; }
|
||||
void setDuration(uint64_t p_Duration) { m_Duration = p_Duration; }
|
||||
void setConfirmed(bool p_Confirmed) { mConfirmed = p_Confirmed; }
|
||||
void setID(string iD) { mSPITTypeID = iD; }
|
||||
void setFixed(bool p_Fixed) { mFixed = p_Fixed; }
|
||||
void setServerRemote(bool p_IsServerRemote) { mServerRemote = p_IsServerRemote; }
|
||||
void setServerProjectIndepended(bool p_ProjectIndpended) { mServerProjectIndepended = p_ProjectIndpended; }
|
||||
void setGroupName(string p_GroupName) { mTypeGroupName = p_GroupName; }
|
||||
void setName(string p_Name) { mSPITTypeName = p_Name; }
|
||||
void setDelay(uint64_t p_Delay) { mDelay = p_Delay; }
|
||||
void setDuration(uint64_t p_Duration) { mDuration = p_Duration; }
|
||||
|
||||
bool fillBytes(std::vector<char> &message);
|
||||
};
|
||||
@@ -449,19 +437,19 @@ class Message {
|
||||
static constexpr int BYTESLENGTH = 45;
|
||||
|
||||
private:
|
||||
string m_SPITTypeID{};
|
||||
string mSPITTypeID{};
|
||||
|
||||
public:
|
||||
RemoveType(const RemoveType &orig);
|
||||
// Receive
|
||||
RemoveType(unique_ptr<Header> p_Header);
|
||||
RemoveType(unique_ptr<Header> header);
|
||||
bool parse(const std::vector<char> &message);
|
||||
|
||||
const string getID() const { return m_SPITTypeID; }
|
||||
const string getID() const { return mSPITTypeID; }
|
||||
|
||||
// Send
|
||||
RemoveType();
|
||||
void setID(string p_ID) { m_SPITTypeID = p_ID; }
|
||||
void setID(string iD) { mSPITTypeID = iD; }
|
||||
bool fillBytes(std::vector<char> &message);
|
||||
};
|
||||
|
||||
@@ -475,71 +463,71 @@ class Message {
|
||||
static constexpr int BYTESLENGTH = 339;
|
||||
|
||||
private:
|
||||
bool m_Confirmed{};
|
||||
string m_SPITObjectID{};
|
||||
bool m_Fixed{};
|
||||
bool m_ServerRemote{};
|
||||
string m_SPITObjectName{};
|
||||
string m_SPITTypeID{};
|
||||
string m_ServerParams{};
|
||||
uint64_t m_FrameStart{};
|
||||
uint64_t m_FrameLength{};
|
||||
uint64_t m_FrameFadeInLength{};
|
||||
uint64_t m_FrameFadeOutLength{};
|
||||
int m_ValueFactor{};
|
||||
char m_ValueUse{VALUEUSE_DISCARD};
|
||||
int m_Track{};
|
||||
string m_Remark{};
|
||||
uint64_t m_Delay{};
|
||||
uint64_t m_Duration{};
|
||||
bool m_ActionAssigned{};
|
||||
bool mConfirmed{};
|
||||
string mSPITObjectID{};
|
||||
bool mFixed{};
|
||||
bool mServerRemote{};
|
||||
string mSPITObjectName{};
|
||||
string mSPITTypeID{};
|
||||
string mServerParams{};
|
||||
uint64_t mFrameStart{};
|
||||
uint64_t mFrameLength{};
|
||||
uint64_t mFrameFadeInLength{};
|
||||
uint64_t mFrameFadeOutLength{};
|
||||
int mValueFactor{};
|
||||
char mValueUse{VALUEUSE_DISCARD};
|
||||
int mTrack{};
|
||||
string mRemark{};
|
||||
uint64_t mDelay{};
|
||||
uint64_t mDuration{};
|
||||
bool mActionAssigned{};
|
||||
|
||||
public:
|
||||
ReportObject(const ReportObject &orig);
|
||||
// Receive
|
||||
ReportObject(unique_ptr<Header> p_Header);
|
||||
ReportObject(unique_ptr<Header> header);
|
||||
bool parse(const std::vector<char> &message);
|
||||
|
||||
bool getConfirmed() const { return m_Confirmed; }
|
||||
const string getID() const { return m_SPITObjectID; }
|
||||
bool getFixed() const { return m_Fixed; }
|
||||
bool getServerRemote() const { return m_ServerRemote; }
|
||||
const string getName() const { return m_SPITObjectName; }
|
||||
const string getSPITTypeID() const { return m_SPITTypeID; }
|
||||
const string getServerParams() const { return m_ServerParams; }
|
||||
uint64_t getFrameStart() const { return m_FrameStart; }
|
||||
uint64_t getFrameLength() const { return m_FrameLength; }
|
||||
uint64_t getFrameFadeInLength() const { return m_FrameFadeInLength; }
|
||||
uint64_t getFrameFadeOutLength() const { return m_FrameFadeOutLength; }
|
||||
int getValueFactor() const { return m_ValueFactor; }
|
||||
char getValueUse() const { return m_ValueUse; }
|
||||
int getTrack() const { return m_Track; }
|
||||
const string getRemark() const { return m_Remark; }
|
||||
uint64_t getDelay() const { return m_Delay; }
|
||||
uint64_t getDuration() const { return m_Duration; }
|
||||
bool getActionAssigned() const { return m_ActionAssigned; }
|
||||
bool getConfirmed() const { return mConfirmed; }
|
||||
const string getID() const { return mSPITObjectID; }
|
||||
bool getFixed() const { return mFixed; }
|
||||
bool getServerRemote() const { return mServerRemote; }
|
||||
const string getName() const { return mSPITObjectName; }
|
||||
const string getSPITTypeID() const { return mSPITTypeID; }
|
||||
const string getServerParams() const { return mServerParams; }
|
||||
uint64_t getFrameStart() const { return mFrameStart; }
|
||||
uint64_t getFrameLength() const { return mFrameLength; }
|
||||
uint64_t getFrameFadeInLength() const { return mFrameFadeInLength; }
|
||||
uint64_t getFrameFadeOutLength() const { return mFrameFadeOutLength; }
|
||||
int getValueFactor() const { return mValueFactor; }
|
||||
char getValueUse() const { return mValueUse; }
|
||||
int getTrack() const { return mTrack; }
|
||||
const string getRemark() const { return mRemark; }
|
||||
uint64_t getDelay() const { return mDelay; }
|
||||
uint64_t getDuration() const { return mDuration; }
|
||||
bool getActionAssigned() const { return mActionAssigned; }
|
||||
// Send
|
||||
public:
|
||||
ReportObject();
|
||||
|
||||
void setConfirmed(bool p_Confirmed) { m_Confirmed = p_Confirmed; };
|
||||
void setID(string p_ID) { m_SPITObjectID = p_ID; };
|
||||
void setFixed(bool p_Fixed) { m_Fixed = p_Fixed; };
|
||||
void setServerRemote(bool p_IsRemote) { m_ServerRemote = p_IsRemote; };
|
||||
void setName(string p_Name) { m_SPITObjectName = p_Name; };
|
||||
void setSPITTypeID(string p_ID) { m_SPITTypeID = p_ID; };
|
||||
void setServerParams(string p_Parameters) { m_ServerParams = p_Parameters; };
|
||||
void setFrameStart(uint64_t p_StartTime) { m_FrameStart = p_StartTime; };
|
||||
void setFrameLength(uint64_t p_Length) { m_FrameLength = p_Length; };
|
||||
void setFrameFadeInLength(uint64_t p_FadeInTime) { m_FrameFadeInLength = p_FadeInTime; };
|
||||
void setFrameFadeOutLength(uint64_t p_FadeOutTime) { m_FrameFadeOutLength = p_FadeOutTime; };
|
||||
void setValueFactor(int p_Volume) { m_ValueFactor = p_Volume; };
|
||||
void setValueUse(char p_ValueUse) { m_ValueUse = p_ValueUse; };
|
||||
void setTrack(int p_Track) { m_Track = p_Track; };
|
||||
void setRemark(string p_Description) { m_Remark = p_Description; };
|
||||
void setConfirmed(bool p_Confirmed) { mConfirmed = p_Confirmed; };
|
||||
void setID(string iD) { mSPITObjectID = iD; };
|
||||
void setFixed(bool p_Fixed) { mFixed = p_Fixed; };
|
||||
void setServerRemote(bool p_IsRemote) { mServerRemote = p_IsRemote; };
|
||||
void setName(string p_Name) { mSPITObjectName = p_Name; };
|
||||
void setSPITTypeID(string iD) { mSPITTypeID = iD; };
|
||||
void setServerParams(string p_Parameters) { mServerParams = p_Parameters; };
|
||||
void setFrameStart(uint64_t p_StartTime) { mFrameStart = p_StartTime; };
|
||||
void setFrameLength(uint64_t p_Length) { mFrameLength = p_Length; };
|
||||
void setFrameFadeInLength(uint64_t p_FadeInTime) { mFrameFadeInLength = p_FadeInTime; };
|
||||
void setFrameFadeOutLength(uint64_t p_FadeOutTime) { mFrameFadeOutLength = p_FadeOutTime; };
|
||||
void setValueFactor(int p_Volume) { mValueFactor = p_Volume; };
|
||||
void setValueUse(char p_ValueUse) { mValueUse = p_ValueUse; };
|
||||
void setTrack(int p_Track) { mTrack = p_Track; };
|
||||
void setRemark(string p_Description) { mRemark = p_Description; };
|
||||
void setDelay(uint64_t p_Delay);
|
||||
void setDuration(uint64_t p_Duration);
|
||||
void setActionAssigned(bool p_ActionAssigned) { m_ActionAssigned = p_ActionAssigned; }
|
||||
void setActionAssigned(bool p_ActionAssigned) { mActionAssigned = p_ActionAssigned; }
|
||||
bool fillBytes(std::vector<char> &message);
|
||||
};
|
||||
|
||||
@@ -551,19 +539,19 @@ class Message {
|
||||
static constexpr int BYTESLENGTH = 45;
|
||||
|
||||
private:
|
||||
string m_SPITObjectID{};
|
||||
string mSPITObjectID{};
|
||||
|
||||
public:
|
||||
RemoveObject(const RemoveObject &orig);
|
||||
// Receive
|
||||
RemoveObject(unique_ptr<Header> p_Header);
|
||||
RemoveObject(unique_ptr<Header> header);
|
||||
bool parse(const std::vector<char> &message);
|
||||
|
||||
const string getID() const { return m_SPITObjectID; }
|
||||
const string getID() const { return mSPITObjectID; }
|
||||
// Send
|
||||
public:
|
||||
RemoveObject();
|
||||
void setID(string p_ID) { m_SPITObjectID = p_ID; }
|
||||
void setID(string iD) { mSPITObjectID = iD; }
|
||||
bool fillBytes(std::vector<char> &message);
|
||||
};
|
||||
|
||||
@@ -577,28 +565,28 @@ class Message {
|
||||
static constexpr int BYTESLENGTH = 119;
|
||||
|
||||
private:
|
||||
string m_PlayerID{};
|
||||
string m_PlayerName{};
|
||||
char m_PlayerType{};
|
||||
bool m_PlayerIsRunning{};
|
||||
uint64_t m_Time; // Frames
|
||||
string mPlayerID{};
|
||||
string mPlayerName{};
|
||||
char mPlayerType{};
|
||||
bool mPlayerIsRunning{};
|
||||
uint64_t mTime; // Frames
|
||||
|
||||
public:
|
||||
PlayStart(const PlayStart &orig);
|
||||
// Receive
|
||||
PlayStart(unique_ptr<Header> p_Header);
|
||||
PlayStart(unique_ptr<Header> header);
|
||||
bool parse(const std::vector<char> &message);
|
||||
|
||||
const string getPlayerID() const { return m_PlayerID; }
|
||||
const string getPlayerName() const { return m_PlayerName; }
|
||||
char getPlayerType() const { return m_PlayerType; }
|
||||
bool getPlayerIsRunning() const { return m_PlayerIsRunning; }
|
||||
uint64_t getTime() const { return m_Time; }
|
||||
const string getPlayerID() const { return mPlayerID; }
|
||||
const string getPlayerName() const { return mPlayerName; }
|
||||
char getPlayerType() const { return mPlayerType; }
|
||||
bool getPlayerIsRunning() const { return mPlayerIsRunning; }
|
||||
uint64_t getTime() const { return mTime; }
|
||||
|
||||
// Send
|
||||
PlayStart(string p_PlayerID, string p_PlayerName, char p_PlayerType);
|
||||
void setPlayerIsRunning(bool p_IsPlaying) { m_PlayerIsRunning = p_IsPlaying; }
|
||||
void setTime(uint64_t p_Time) { m_Time = p_Time; }
|
||||
void setPlayerIsRunning(bool p_IsPlaying) { mPlayerIsRunning = p_IsPlaying; }
|
||||
void setTime(uint64_t p_Time) { mTime = p_Time; }
|
||||
bool fillBytes(std::vector<char> &message);
|
||||
};
|
||||
|
||||
@@ -610,34 +598,34 @@ class Message {
|
||||
static constexpr int BYTESLENGTH = 100;
|
||||
|
||||
private:
|
||||
string m_PlayerID{};
|
||||
string m_SPITObjectID{};
|
||||
uint64_t m_FrameInsideObject{}; // Frames
|
||||
bool m_PlayPrePosition{};
|
||||
int m_Value{};
|
||||
char m_ValueFlag{VALUEFLAG_DIRECT};
|
||||
string mPlayerID{};
|
||||
string mSPITObjectID{};
|
||||
uint64_t mFrameInsideObject{}; // Frames
|
||||
bool mPlayPrePosition{};
|
||||
int mValue{};
|
||||
char mValueFlag{VALUEFLAG_DIRECT};
|
||||
|
||||
public:
|
||||
PlayObject(const PlayObject &orig);
|
||||
// Receive
|
||||
PlayObject(unique_ptr<Header> p_Header);
|
||||
PlayObject(unique_ptr<Header> header);
|
||||
bool parse(const std::vector<char> &message);
|
||||
|
||||
const string getPlayerID() const { return m_PlayerID; }
|
||||
const string getSPITObjectID() const { return m_SPITObjectID; }
|
||||
uint64_t getFrameInsideObject() const { return m_FrameInsideObject; }
|
||||
bool getPlayPrePosition() const { return m_PlayPrePosition; }
|
||||
int getValue() const { return m_Value; }
|
||||
char getValueFlag() const { return m_ValueFlag; }
|
||||
const string getPlayerID() const { return mPlayerID; }
|
||||
const string getSPITObjectID() const { return mSPITObjectID; }
|
||||
uint64_t getFrameInsideObject() const { return mFrameInsideObject; }
|
||||
bool getPlayPrePosition() const { return mPlayPrePosition; }
|
||||
int getValue() const { return mValue; }
|
||||
char getValueFlag() const { return mValueFlag; }
|
||||
// Send
|
||||
PlayObject();
|
||||
|
||||
void setPlayerID(string p_PlayerID) { m_PlayerID = p_PlayerID; }
|
||||
void setID(string p_ID) { m_SPITObjectID = p_ID; }
|
||||
void setFrameInsideObject(uint64_t p_TimeInside) { m_FrameInsideObject = p_TimeInside; }
|
||||
void setPlayPrePosition(bool p_PlayOldPosition) { m_PlayPrePosition = p_PlayOldPosition; }
|
||||
void setValue(int p_Value) { m_Value = p_Value; }
|
||||
void setValueFlag(char p_ValueFlag) { m_ValueFlag = p_ValueFlag; }
|
||||
void setPlayerID(string p_PlayerID) { mPlayerID = p_PlayerID; }
|
||||
void setID(string iD) { mSPITObjectID = iD; }
|
||||
void setFrameInsideObject(uint64_t p_TimeInside) { mFrameInsideObject = p_TimeInside; }
|
||||
void setPlayPrePosition(bool p_PlayOldPosition) { mPlayPrePosition = p_PlayOldPosition; }
|
||||
void setValue(int p_Value) { mValue = p_Value; }
|
||||
void setValueFlag(char p_ValueFlag) { mValueFlag = p_ValueFlag; }
|
||||
bool fillBytes(std::vector<char> &message);
|
||||
};
|
||||
|
||||
@@ -648,14 +636,14 @@ class Message {
|
||||
static constexpr int BYTESLENGTH = 45;
|
||||
|
||||
private:
|
||||
string m_PlayerID{};
|
||||
string mPlayerID{};
|
||||
|
||||
public:
|
||||
PlayEnd(const PlayEnd &orig);
|
||||
// Receive
|
||||
PlayEnd(unique_ptr<Header> p_Header);
|
||||
PlayEnd(unique_ptr<Header> header);
|
||||
bool parse(const std::vector<char> &message);
|
||||
const string getPlayerID() const { return m_PlayerID; }
|
||||
const string getPlayerID() const { return mPlayerID; }
|
||||
|
||||
// Send
|
||||
PlayEnd(string p_PlayerID);
|
||||
@@ -669,23 +657,23 @@ class Message {
|
||||
static constexpr int BYTESLENGTH = 57;
|
||||
|
||||
private:
|
||||
string m_SPITObjectID{};
|
||||
uint64_t m_FrameInsideObject{};
|
||||
int m_Value{};
|
||||
string mSPITObjectID{};
|
||||
uint64_t mFrameInsideObject{};
|
||||
int mValue{};
|
||||
|
||||
public:
|
||||
ReportPlayStatus(const ReportPlayStatus &orig);
|
||||
// Receive
|
||||
ReportPlayStatus(unique_ptr<Header> p_Header);
|
||||
ReportPlayStatus(unique_ptr<Header> header);
|
||||
bool parse(const std::vector<char> &message);
|
||||
|
||||
const string getID() const { return m_SPITObjectID; }
|
||||
uint64_t getFrameInsideObject() const { return m_FrameInsideObject; }
|
||||
int getValue() const { return m_Value; }
|
||||
const string getID() const { return mSPITObjectID; }
|
||||
uint64_t getFrameInsideObject() const { return mFrameInsideObject; }
|
||||
int getValue() const { return mValue; }
|
||||
// Send
|
||||
ReportPlayStatus();
|
||||
|
||||
void setID(string p_ID);
|
||||
void setID(string iD);
|
||||
void setFrameInsideObject(uint64_t p_TimeInside);
|
||||
void setValue(int p_Value);
|
||||
bool fillBytes(std::vector<char> &message);
|
||||
|
||||
Reference in New Issue
Block a user