VR-Forces 4.5 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
bufferSerialize.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2006 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
12 
13 #pragma once
14 
15 #include "vrfutil/vrfutilDefines.h"
16 #include <vlutil/vlString.h>
17 #include <vlutil/vlMachineTypes.h>
18 #include <matrix/vlVector.h>
19 #include <matrix/vlTaitBryan.h>
20 #include <vlutil/vlFilename.h>
22 #include <vector>
23 #include <set>
24 #include <list>
25 #include <string>
26 #include "vrfutil/rwBoolean.h"
27 #include "vrfutil/rwInt.h"
28 #include "vrfutil/rwReal.h"
29 #include "vrfutil/rwObjectType.h"
30 #include "vrfutil/rwStringList.h"
31 #include "vrfutil/rwIntegerList.h"
32 #include "vrfutil/rwUUID.h"
34 #include "vrfutil/rwSphere.h"
35 #include "vrfutil/rwForceType.h"
37 #include "vrfutil/rwReal.h"
38 #include "vrfutil/rwUnsigned.h"
41 
42 #include <vlpi/entityIdentifier.h>
43 #include <vlpi/appearance.h>
44 #include <vlutil/vlInetAddr.h>
45 
46 #include <boost/unordered_map.hpp>
47 #include <boost/unordered_set.hpp>
48 
52 class DtRwPlanVariable;
54 
60 namespace DtBufferSerialize
61 {
69 
70  DT_DLL_vrfutil char *encode(const DtFilename& val, char *buffer);
71  DT_DLL_vrfutil char *encode(const DtString& val, char *buffer);
72  DT_DLL_vrfutil char *encode(const std::string& val, char *buffer);
73  DT_DLL_vrfutil char *encode(const char *val, unsigned nSize, char *buffer);
74  DT_DLL_vrfutil char *encode(const int& val, char *buffer);
75  DT_DLL_vrfutil char *encode(const DtInt16& val, char *buffer);
76  DT_DLL_vrfutil char *encode(const DtU8& val, char *buffer);
77  DT_DLL_vrfutil char *encode(const DtU16& val, char *buffer);
78  DT_DLL_vrfutil char *encode(const DtU32& val, char *buffer);
79  DT_DLL_vrfutil char *encode(const DtU64& val, char *buffer);
80  DT_DLL_vrfutil char *encode(const DtFloat32& val, char *buffer);
81  DT_DLL_vrfutil char *encode(const DtFloat64& val, char *buffer);
82  DT_DLL_vrfutil char *encode(const DtVector& val, char *buffer);
83  DT_DLL_vrfutil char *encode(const DtSphere& val, char *buffer);
84  DT_DLL_vrfutil char *encode(const DtTaitBryan& val, char *buffer);
85  DT_DLL_vrfutil char *encode(const bool& val, char *buffer);
86  DT_DLL_vrfutil char *encode(const DtObjectType& val, char *buffer);
87  DT_DLL_vrfutil char *encode(const std::vector<char>& val, char *buffer);
88  DT_DLL_vrfutil char *encode(const DtRwBoolean& val, char *buffer);
89  DT_DLL_vrfutil char *encode(const DtEntityType& val, char *buffer);
90  DT_DLL_vrfutil char *encode(const DtEntityIdentifier& val, char *buffer);
91  DT_DLL_vrfutil char *encode(const DtSimulationAddress& val, char *buffer);
92  DT_DLL_vrfutil char *encode(const DtAppearance& val, char *buffer);
93  DT_DLL_vrfutil char *encode(const DtForceType& val, char *buffer);
94  DT_DLL_vrfutil char *encode(const DtInetAddr& val, char *buffer);
95  DT_DLL_vrfutil char *encode(const DtRwInt& val, char* buffer);
96  DT_DLL_vrfutil char *encode(const DtRwVariableBindings& val, char* buffer);
97  DT_DLL_vrfutil char *encode(const DtRwTranslatableStringObject& val, char* buffer);
98  DT_DLL_vrfutil char *encode(const DtRwObjectType& val, char* buffer);
99  DT_DLL_vrfutil char *encode(const DtRwStringList& val, char* buffer);
100  DT_DLL_vrfutil char *encode(const DtRwIntegerList& val, char* buffer);
101  DT_DLL_vrfutil char *encode(const DtUUID& val, char* buffer);
102  DT_DLL_vrfutil char *encode(const DtRwUUID& val, char* buffer);
103  DT_DLL_vrfutil char *encode(const DtRwNLengthStringVector& val, char* buffer);
104  DT_DLL_vrfutil char *encode(const DtRwNLengthUUIDVector& val, char* buffer);
105  DT_DLL_vrfutil char *encode(const DtRwJoystickControl& val, char* buffer);
106  DT_DLL_vrfutil char *encode(const DtRwPlanVariable& val, char* buffer);
107  DT_DLL_vrfutil char *encode(const DtRwPlanSimulationObject& val, char* buffer);
108 
109  template <typename T>
110  char* encode(const std::vector<T>& val, char* buffer);
111  template <typename T>
112  char* encode(const std::set<T>& val, char* buffer);
113  template <typename T>
114  char* encode(const std::list<T>& val, char* buffer);
115  template <typename T1, typename T2>
116  char* encode(const std::map<T1, T2>& val, char* buffer);
117  template <typename T1, typename T2>
118  char* encode(const boost::unordered_map<T1, T2>& val, char* buffer);
119  template <typename T1>
120  char* encode(const boost::unordered_set<T1>& val, char* buffer);
121  template <typename T1, typename T2>
122  char* encode(const std::pair<T1, T2>& val, char* buffer);
123 
124  //specialized version of decode for std::vector<bool> due to problems with c++
125  //standard on how vector<bool> is defined
126  DT_DLL_vrfutil char *encode(const std::vector<bool>& val, char *buffer);
128 
129 
137 
138  DT_DLL_vrfutil const char *decode(DtString& val, const char *buffer) ;
139  DT_DLL_vrfutil const char *decode(std::string& val, const char *buffer) ;
140  DT_DLL_vrfutil const char *decode(DtFilename& val, const char *buffer) ;
141  DT_DLL_vrfutil const char *decode(int& val, const char *buffer) ;
142  DT_DLL_vrfutil const char *decode(DtU8& val, const char *buffer) ;
143  DT_DLL_vrfutil const char *decode(DtU16& val, const char *buffer) ;
144  DT_DLL_vrfutil const char *decode(DtU32& val, const char *buffer) ;
145  DT_DLL_vrfutil const char *decode(DtU64& val, const char *buffer) ;
146  DT_DLL_vrfutil const char *decode(DtFloat32& val, const char *buffer) ;
147  DT_DLL_vrfutil const char *decode(DtFloat64& val, const char *buffer) ;
148  DT_DLL_vrfutil const char *decode(DtVector& val, const char *buffer) ;
149  DT_DLL_vrfutil const char *decode(DtSphere& val, const char *buffer) ;
150  DT_DLL_vrfutil const char *decode(DtTaitBryan& val, const char *buffer) ;
151  DT_DLL_vrfutil const char *decode(bool &val, const char *buffer) ;
152  DT_DLL_vrfutil const char *decode(DtObjectType &val, const char *buffer) ;
153  DT_DLL_vrfutil const char *decode(std::vector<char>& val, const char *buffer) ;
154  DT_DLL_vrfutil const char *decode(DtRwBoolean &val, const char *buffer) ;
155  DT_DLL_vrfutil const char *decode(DtEntityType& val, const char *buffer);
156  DT_DLL_vrfutil const char *decode(DtEntityIdentifier& val, const char *buffer);
157  DT_DLL_vrfutil const char *decode(DtSimulationAddress& val, const char *buffer);
158  DT_DLL_vrfutil const char *decode(DtAppearance& val, const char *buffer);
159  DT_DLL_vrfutil const char *decode(DtForceType& val, const char *buffer);
160  DT_DLL_vrfutil const char *decode(DtInetAddr& val, const char *buffer);
161  DT_DLL_vrfutil const char *decode(DtRwInt& val, const char *buffer);
162  DT_DLL_vrfutil const char *decode(DtRwObjectType& val, const char *buffer);
163  DT_DLL_vrfutil const char *decode(DtRwStringList& val, const char *buffer);
164  DT_DLL_vrfutil const char *decode(DtRwIntegerList& val, const char *buffer);
165  DT_DLL_vrfutil const char *decode(DtUUID& val, const char *buffer);
166  DT_DLL_vrfutil const char *decode(DtRwUUID& val, const char *buffer);
167  DT_DLL_vrfutil const char *decode(DtRwNLengthStringVector& val, const char *buffer);
168  DT_DLL_vrfutil const char *decode(DtRwNLengthUUIDVector& val, const char *buffer);
169  DT_DLL_vrfutil const char *decode(DtRwVariableBindings& val, const char *buffer);
170  DT_DLL_vrfutil const char *decode(DtRwTranslatableStringObject& val, const char *buffer);
171  DT_DLL_vrfutil const char *decode(DtRwJoystickControl& val, const char *buffer);
172  DT_DLL_vrfutil const char *decode(DtRwPlanVariable& val, const char *buffer);
173  DT_DLL_vrfutil const char *decode(DtRwPlanSimulationObject& val, const char *buffer);
174 
175  template <typename T>
176  const char *decode(std::vector<T>& val, const char *buffer);
177  template <typename T>
178  const char *decode(std::set<T>& val, const char *buffer);
179  template <typename T>
180  const char *decode(std::list<T>& val, const char *buffer);
181  template <typename T1, typename T2>
182  const char *decode(std::map<T1, T2>& val, const char *buffer);
183  template <typename T1, typename T2>
184  const char *decode(boost::unordered_map<T1, T2>& val, const char *buffer);
185  template <typename T1>
186  const char *decode(boost::unordered_set<T1>& val, const char *buffer);
187  template <typename T1, typename T2>
188  const char *decode(std::pair<T1, T2>& val, const char *buffer);
189 
190  //specialized version of decode for std::vector<bool> due to problems with c++
191  //standard on how vector<bool> is defined
192  DT_DLL_vrfutil const char *decode(std::vector<bool>& val, const char *buffer);
194 
198 
200  DT_DLL_vrfutil int getSize(const DtString& val) ;
201  DT_DLL_vrfutil int getSize(const std::string& val);
202  DT_DLL_vrfutil int getSize(const DtFilename& val) ;
203  DT_DLL_vrfutil int getSize(const DtVector& v) ;
204  DT_DLL_vrfutil int getSize(const DtSphere& v) ;
205  DT_DLL_vrfutil int getSize(const int& v) ;
206  DT_DLL_vrfutil int getSize(const DtU8& v) ;
207  DT_DLL_vrfutil int getSize(const DtU16& v) ;
208  DT_DLL_vrfutil int getSize(const DtU32& v) ;
209  DT_DLL_vrfutil int getSize(const DtU64& v) ;
210  DT_DLL_vrfutil int getSize(const DtFloat32& v) ;
211  DT_DLL_vrfutil int getSize(const DtFloat64& v) ;
212  DT_DLL_vrfutil int getSize(const bool&v) ;
213  DT_DLL_vrfutil int getSize(const DtObjectType& v) ;
214  DT_DLL_vrfutil int getSize(const DtTaitBryan& v) ;
215  DT_DLL_vrfutil int getSize(const std::vector<char>& v) ;
216  DT_DLL_vrfutil int getSize(const DtRwBoolean& v) ;
217  DT_DLL_vrfutil int getSize(const DtEntityType& v);
218  DT_DLL_vrfutil int getSize(const DtEntityIdentifier& v);
219  DT_DLL_vrfutil int getSize(const DtSimulationAddress& v);
220  DT_DLL_vrfutil int getSize(const DtAppearance& v);
221  DT_DLL_vrfutil int getSize(const DtForceType& v);
222  DT_DLL_vrfutil int getSize(const DtInetAddr& v);
223  DT_DLL_vrfutil int getSize(const DtRwInt& v);
224  DT_DLL_vrfutil int getSize(const DtRwObjectType& v);
227  DT_DLL_vrfutil int getSize(const DtRwStringList& v);
228  DT_DLL_vrfutil int getSize(const DtRwIntegerList& v);
229  DT_DLL_vrfutil int getSize(const DtUUID& v);
230  DT_DLL_vrfutil int getSize(const DtRwUUID& v);
235 
236  template <typename T>
237  int getSize(const std::vector<T>& v) ;
238  template <typename T>
239  int getSize(const std::list<T>& v) ;
240  template <typename T1, typename T2>
241  int getSize(const std::map<T1, T2>& v) ;
242  template <typename T1, typename T2>
243  int getSize(const boost::unordered_map<T1, T2>& v) ;
244  template <typename T1>
245  int getSize(const boost::unordered_set<T1>& v) ;
246  template <typename T1, typename T2>
247  int getSize(const std::pair<T1, T2>& v) ;
248  template <typename T>
249  int getSize(const std::set<T>& v) ;
250 
251  //specialized version of decode for std::vector<bool> due to problems with c++
252  //standard on how vector<bool> is defined
253  DT_DLL_vrfutil int getSize(const std::vector<bool>& v);
255 
258  DT_DLL_vrfutil int getSize(const DtSimInterfaceContent* const& contentPtr);
259 
264  DT_DLL_vrfutil char *encode(const DtSimInterfaceContent* const& adminContentPtr, char *buffer);
265 
274  DT_DLL_vrfutil const char *decode(DtSimInterfaceContent*& interfaceContentPtr, const char *buffer);
275 }
276 
277 #define bufferSerialize_INL_
278 #include "vrfutil/bufferSerialize.inl"
279 #undef bufferSerialize_INL_
280 

Document ID: Generated on Thu Mar 23 18:54:12 EDT 2017 from SVN revision 174804
Copyright © 2005-2017 VT MÄK. All Rights Reserved (www.mak.com)