VR-Forces 5.0.2 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
rwIntSized.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2017 MaK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
16 
17 #pragma once
18 
19 #include <vlutil/vlMachineTypes.h>
20 #include <readerWriter/rwInt.h>
21 #include <readerWriter/rwTypes.h>
22 
24 
26 
27 
30 {
31 public:
33  DtRwInt8() : DtRwInt() {}
34 
36  DtRwInt8(const DtString& name, DtReaderWriterRegistry* const parentRegistry = NULL)
37  : DtRwInt(name, parentRegistry) {}
38 
39  DtRwInt8(const DtSymbolString& name, DtReaderWriterRegistry* const parentRegistry = NULL)
40  : DtRwInt(name, parentRegistry) {}
41 
43  DtRwInt8(const DtString& name, int value, DtReaderWriterRegistry* const parentRegistry = NULL)
44  : DtRwInt(name, value, parentRegistry) {}
45 
47  DtRwInt8(const DtSymbolString& name, int value, DtReaderWriterRegistry* const parentRegistry = NULL)
48  : DtRwInt(name, value, parentRegistry) {}
49 
51  DtRwInt8(int orig, DtReaderWriterRegistry* const parentRegistry = NULL)
52  : DtRwInt(orig, parentRegistry) {}
53 
54  DtRwInt8(const DtRwInt& orig, DtReaderWriterRegistry* const parentRegistry = NULL)
55  : DtRwInt(orig, parentRegistry) {}
56 
57  virtual const char* readerWriterType() const
58  {
59  return DtRwInt8Type;
60  }
61 
62  static const char* theXmlType()
63  {
64  return DtXMLInt8Type;
65  }
66 
67  virtual const char* xmlType() const
68  {
69  return theXmlType();
70  }
71 
72  virtual int alignment() const
73  {
74  return 1;
75  }
76 
77 };
78 
81 {
82 public:
84  DtRwInt16() : DtRwInt() {}
85 
87  DtRwInt16(const DtString& name, DtReaderWriterRegistry* const parentRegistry = NULL)
88  : DtRwInt(name, parentRegistry) {}
89 
90  DtRwInt16(const DtSymbolString& name, DtReaderWriterRegistry* const parentRegistry = NULL)
91  : DtRwInt(name, parentRegistry) {}
92 
94  DtRwInt16(const DtString& name, int value, DtReaderWriterRegistry* const parentRegistry = NULL)
95  : DtRwInt(name, value, parentRegistry) {}
96 
98  DtRwInt16(const DtSymbolString& name, int value, DtReaderWriterRegistry* const parentRegistry = NULL)
99  : DtRwInt(name, value, parentRegistry) {}
100 
102  DtRwInt16(int orig, DtReaderWriterRegistry* const parentRegistry = NULL)
103  : DtRwInt(orig, parentRegistry) {}
104 
105  DtRwInt16(const DtRwInt& orig, DtReaderWriterRegistry* const parentRegistry = NULL)
106  : DtRwInt(orig, parentRegistry) {}
107 
108  virtual const char* readerWriterType() const
109  {
110  return DtRwInt16Type;
111  }
112 
113  static const char* theXmlType()
114  {
115  return DtXMLInt16Type;
116  }
117 
118  virtual const char* xmlType() const
119  {
120  return theXmlType();
121  }
122 
123  virtual int alignment() const
124  {
125  return 2;
126  }
127 
128 };
129 
132 {
133 public:
136 
138  DtRwInt32(const DtString& name, DtReaderWriterRegistry* const parentRegistry = NULL)
139  : DtRwInt(name, parentRegistry) {}
140 
141  DtRwInt32(const DtSymbolString& name, DtReaderWriterRegistry* const parentRegistry = NULL)
142  : DtRwInt(name, parentRegistry) {}
143 
145  DtRwInt32(const DtString& name, int value, DtReaderWriterRegistry* const parentRegistry = NULL)
146  : DtRwInt(name, value, parentRegistry) {}
147 
149  DtRwInt32(const DtSymbolString& name, int value, DtReaderWriterRegistry* const parentRegistry = NULL)
150  : DtRwInt(name, value, parentRegistry) {}
151 
153  DtRwInt32(int orig, DtReaderWriterRegistry* const parentRegistry = NULL)
154  : DtRwInt(orig, parentRegistry) {}
155 
156  DtRwInt32(const DtRwInt& orig, DtReaderWriterRegistry* const parentRegistry = NULL)
157  : DtRwInt(orig, parentRegistry) {}
158 
159  virtual const char* readerWriterType() const
160  {
161  return DtRwInt32Type;
162  }
163 
164  static const char* theXmlType()
165  {
166  return DtXMLInt32Type;
167  }
168 
169  virtual const char* xmlType() const
170  {
171  return theXmlType();
172  }
173 
174  virtual int alignment() const
175  {
176  return 4;
177  }
178 
179 };
180 
181 namespace DtBufferSerialize
182 {
184  DT_DLL_readerWriter int getSize(const DtRwInt8& val);
185  DT_DLL_readerWriter int getSize(const DtRwInt16& val);
186  DT_DLL_readerWriter int getSize(const DtRwInt32& val);
187 
194  DT_DLL_readerWriter char *encode(const DtRwInt8& val, char *buffer);
195  DT_DLL_readerWriter char *encode(const DtRwInt16& val, char *buffer);
196  DT_DLL_readerWriter char *encode(const DtRwInt32& val, char *buffer);
197 
204  DT_DLL_readerWriter const char *decode(DtRwInt8 &val, const char *buffer);
205  DT_DLL_readerWriter const char *decode(DtRwInt16 &val, const char *buffer);
206  DT_DLL_readerWriter const char *decode(DtRwInt32 &val, const char *buffer);
207 }
208 
209 
DT_DLL_readerWriter int getSize(const DtString &val)
The number of bytes required to encode the value.
#define DT_DLL_readerWriter
This file is used to determine how to build Disable inconsistent dll linkage warning Visual Studio 6...
Definition: readerWriterDefines.h:34
DtRwInt8(const DtSymbolString &name, int value, DtReaderWriterRegistry *const parentRegistry=NULL)
real constructor from an int
Definition: rwIntSized.h:47
DtRwInt32(const DtSymbolString &name, DtReaderWriterRegistry *const parentRegistry=NULL)
Definition: rwIntSized.h:141
DtRwInt that encodes the value as a 32 bit integer.
Definition: rwIntSized.h:131
virtual const char * readerWriterType() const
Used to supply a string type that this reader writer type is. This can be used in place of dynamic-ca...
Definition: rwIntSized.h:57
Definition: symbolString.h:20
virtual const char * xmlType() const
Routines to archive/dearchive from an XML Environment.
Definition: rwIntSized.h:67
DtRwInt16(const DtRwInt &orig, DtReaderWriterRegistry *const parentRegistry=NULL)
Definition: rwIntSized.h:105
const char DtRwInt8Type[]
Definition: rwTypes.h:25
const char DtXMLInt16Type[]
Definition: rwTypes.h:28
DtRwInt16(const DtSymbolString &name, DtReaderWriterRegistry *const parentRegistry=NULL)
Definition: rwIntSized.h:90
DtRwInt that encodes the value as an 8 bit integer.
Definition: rwIntSized.h:29
DtRwInt8()
default constructor
Definition: rwIntSized.h:33
static const char * theXmlType()
Definition: rwIntSized.h:164
DtRwInt16(const DtString &name, DtReaderWriterRegistry *const parentRegistry=NULL)
real constructor
Definition: rwIntSized.h:87
DtRwInt32(const DtString &name, int value, DtReaderWriterRegistry *const parentRegistry=NULL)
real constructor from an int
Definition: rwIntSized.h:145
DtRwInt32(const DtSymbolString &name, int value, DtReaderWriterRegistry *const parentRegistry=NULL)
real constructor from an int
Definition: rwIntSized.h:149
virtual const char * xmlType() const
Routines to archive/dearchive from an XML Environment.
Definition: rwIntSized.h:169
Definition: readerWriterRegistry.h:39
DtRwInt32(const DtString &name, DtReaderWriterRegistry *const parentRegistry=NULL)
real constructor
Definition: rwIntSized.h:138
virtual int alignment() const
Return HLA network alignment. sizeof(int)
Definition: rwIntSized.h:72
DtRwInt16(const DtSymbolString &name, int value, DtReaderWriterRegistry *const parentRegistry=NULL)
real constructor from an int
Definition: rwIntSized.h:98
virtual int alignment() const
Return HLA network alignment. sizeof(int)
Definition: rwIntSized.h:174
virtual int alignment() const
Return HLA network alignment. sizeof(int)
Definition: rwIntSized.h:123
DtRwInt8(const DtString &name, int value, DtReaderWriterRegistry *const parentRegistry=NULL)
real constructor from an int
Definition: rwIntSized.h:43
Description: Readable, Writable int.
Definition: rwInt.h:25
DtRwInt16(const DtString &name, int value, DtReaderWriterRegistry *const parentRegistry=NULL)
real constructor from an int
Definition: rwIntSized.h:94
DtRwInt32(int orig, DtReaderWriterRegistry *const parentRegistry=NULL)
copy constructor
Definition: rwIntSized.h:153
DtRwInt8(const DtString &name, DtReaderWriterRegistry *const parentRegistry=NULL)
real constructor
Definition: rwIntSized.h:36
DtRwInt16()
default constructor
Definition: rwIntSized.h:84
DtRwInt that encodes the value as a 16 bit integer.
Definition: rwIntSized.h:80
DtRwInt32()
default constructor
Definition: rwIntSized.h:135
const char DtRwInt16Type[]
Definition: rwTypes.h:27
static const char * theXmlType()
Definition: rwIntSized.h:62
DT_DLL_readerWriter char * encode(const DtFilename &val, char *buffer)
Serializes the provided value val into buffer. buffer must have at least the number of bytes returned...
virtual const char * xmlType() const
Routines to archive/dearchive from an XML Environment.
Definition: rwIntSized.h:118
static const char * theXmlType()
The type that is used when archiving to an XML stream.
const char DtXMLInt32Type[]
Definition: rwTypes.h:30
virtual const char * readerWriterType() const
Used to supply a string type that this reader writer type is. This can be used in place of dynamic-ca...
Definition: rwIntSized.h:159
DtRwInt8(const DtSymbolString &name, DtReaderWriterRegistry *const parentRegistry=NULL)
Definition: rwIntSized.h:39
DtRwInt32(const DtRwInt &orig, DtReaderWriterRegistry *const parentRegistry=NULL)
Definition: rwIntSized.h:156
static const char * theXmlType()
Definition: rwIntSized.h:113
DT_DLL_readerWriter const char * decode(DtString &val, const char *buffer)
Decodes a value from buffer and places the result in val of the type specified by val...
virtual const char * readerWriterType() const
Used to supply a string type that this reader writer type is. This can be used in place of dynamic-ca...
Definition: rwIntSized.h:108
DtRwInt8(const DtRwInt &orig, DtReaderWriterRegistry *const parentRegistry=NULL)
Definition: rwIntSized.h:54
DtRwInt16(int orig, DtReaderWriterRegistry *const parentRegistry=NULL)
copy constructor
Definition: rwIntSized.h:102
const char DtXMLInt8Type[]
Definition: rwTypes.h:26
const char DtRwInt32Type[]
Definition: rwTypes.h:29
DtRwInt8(int orig, DtReaderWriterRegistry *const parentRegistry=NULL)
copy constructor
Definition: rwIntSized.h:51

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)