VR-Forces 5.0.2 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
vrfTDLMessage.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2017 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
6 #pragma once
7 
9 
12 
13 #include "vrfmsgs/vrfmsgsDefines.h"
14 #include <vlutil/vlMachineTypes.h>
15 #include <vlutil/vlNetTypes.h>
16 #include <vlpi/simulationAddress.h>
17 
25 
29 {
31  : myHeaderVersion(0)
32  , myMessageVersion(0)
33  , myMessageType(0)
36  , myTimeStamp(0)
37  , myFixedSize(0)
38  , myVariableSize(0)
39  {
40  }
41 
42  DtNetU32 myHeaderVersion;
43  DtNetU32 myMessageVersion;
44  DtNetU32 myMessageType;
45  DtNetU32 myFixedSize;
46  DtNetU32 myVariableSize;
48  DtNetU32 mySenderUUIDLength;
49  DtNetU64 myTimeStamp;
50 };
51 
53 
55 {
56 public:
57 
60 
62  DtVrfTDLMessage(const DtVrfTDLMessage & orig);
63 
65  const DtVrfTDLMessage & operator=(DtVrfTDLMessage & orig);
66 
68  virtual ~DtVrfTDLMessage();
69 
71  virtual int tdlMessageType() const;
72 
73  virtual DtVrfTDLMessage * clone() const;
74  static DtVrfTDLMessage* creator();
75 
76  virtual int messageVersion() const;
77  virtual int headerVersion() const;
78 
80  virtual int getContentType(const char* buffer);
81 
83  virtual void printDataToString(DtString& str);
84 
86  static void setFactory(DtVrfTDLMessageFactory*);
87  static DtVrfTDLMessageFactory* factory();
88 
90  virtual void setRecipient(const DtSimulationAddress & recipient);
91  virtual const DtSimulationAddress & recipient() const;
92 
94  virtual void setSender(const DtSimulationAddress & recipient);
95  virtual const DtSimulationAddress & sender() const;
96 
98  virtual int netRepSize() const;
99 
102  virtual const char* netRep();
103 
107  virtual void setToNet(char* buffer);
108 
110  virtual bool setFromNet(const char* buffer, int bufferSize);
111 
115  virtual int fixedSize() const;
116 
118  virtual int variableSize() const;
119 
121  virtual void setMarkingText(const DtString&);
122  virtual const DtString& markingText() const;
123 
125  virtual void setUUID(const DtString&);
126  virtual const DtString& uuid() const;
127 
129  virtual void setTimeStamp(unsigned int);
130  virtual unsigned int timeStamp() const;
131 
132 protected:
134  virtual char* createNetworkBuffer();
135 
137  virtual void setFixedToNet(char* buffer);
138 
141  virtual int setFixedFromNet(const char* buffer);
142 
145  virtual const char* setVariableFromNet(const char* buffer, const char* fixedBuffer, int messageVersion);
146 
148  virtual char* setVariableToNet(char* buffer);
149 
150 protected:
152 
153  DtSimulationAddress myRecipient;
154  DtSimulationAddress mySender;
155 
156  char* myNetRep;
158 
161  unsigned int myTimeStamp;
162 };
int myLastAllocatedSize
Definition: vrfTDLMessage.h:157
#define DT_DLL_vrfmsgs
This file is used to determine how to build.
Definition: vrfmsgsDefines.h:28
DtNetU32 myVariableSize
The fixed size of the message.
Definition: vrfTDLMessage.h:46
DtString myUUID
Definition: vrfTDLMessage.h:160
DtSimulationAddress mySender
Definition: vrfTDLMessage.h:154
DtNetU64 myTimeStamp
The length of the VRF UUID to follow this structure.
Definition: vrfTDLMessage.h:49
DtNetU32 mySenderMarkingTextLength
The variable size of the message.
Definition: vrfTDLMessage.h:47
DtNetU32 myMessageVersion
The version number of this header.
Definition: vrfTDLMessage.h:43
DtString myMarkingText
Definition: vrfTDLMessage.h:159
DtSimulationAddress myRecipient
Definition: vrfTDLMessage.h:153
Contains the DtVrfTDLMessage class declaration.
Definition: vrfTDLMessage.h:28
DtNetU32 myMessageType
The version of this message.
Definition: vrfTDLMessage.h:44
DtVrfTDLMessageHeader()
Definition: vrfTDLMessage.h:30
Definition: vrfTDLMessage.h:54
unsigned int myTimeStamp
Definition: vrfTDLMessage.h:161
DtNetU32 myFixedSize
The VRF TDL message type.
Definition: vrfTDLMessage.h:45
char * myNetRep
Definition: vrfTDLMessage.h:156
DtVrfTDLMessageFactory is a map of creators by type for VRF TDL Messages.
Definition: vrfTDLMessageFactory.h:17
DtNetU32 mySenderUUIDLength
The length of the marking text that is to follow this structure (NOT null terminated) ...
Definition: vrfTDLMessage.h:48
static DtVrfTDLMessageFactory * theVrfTDLMessageFactory
Definition: vrfTDLMessage.h:151
DtNetU32 myHeaderVersion
Definition: vrfTDLMessage.h:42

Document ID: Generated on Sun Dec 4 20:22:03 EST 2022 from SVN revision 249613
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)