VR-Forces 4.6 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties 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/rwIntSized.h"
29 #include "vrfutil/rwReal.h"
30 #include "vrfutil/rwRealSized.h"
31 #include "vrfutil/rwObjectType.h"
32 #include "vrfutil/rwStringList.h"
33 #include "vrfutil/rwIntegerList.h"
34 #include "vrfutil/rwUUID.h"
36 #include "vrfutil/rwSphere.h"
37 #include "vrfutil/rwForceType.h"
38 #include "vrfutil/rwOrbatData.h"
40 #include "vrfutil/rwReal.h"
41 #include "vrfutil/rwUnsigned.h"
44 
45 #include <vlpi/entityIdentifier.h>
46 #include <vlpi/appearance.h>
47 #include <vlutil/vlInetAddr.h>
48 
49 #include <boost/unordered_map.hpp>
50 #include <boost/unordered_set.hpp>
51 
55 class DtRwPlanVariable;
57 
63 namespace DtBufferSerialize
64 {
72 
73  DT_DLL_vrfutil char *encode(const DtFilename& val, char *buffer);
74  DT_DLL_vrfutil char *encode(const DtString& val, char *buffer);
75  DT_DLL_vrfutil char *encode(const std::string& val, char *buffer);
76  DT_DLL_vrfutil char *encode(const char *val, unsigned nSize, char *buffer);
77  DT_DLL_vrfutil char *encode(const int& val, char *buffer);
78  DT_DLL_vrfutil char *encode(const DtInt16& val, char *buffer);
79 #ifndef DT_HAVE_64BIT_LONGS
80  DT_DLL_vrfutil char *encode(const DtInt32& val, char *buffer);
81 #endif
82  DT_DLL_vrfutil char *encode(const DtU8& val, char *buffer);
83  DT_DLL_vrfutil char *encode(const DtU16& val, char *buffer);
84  DT_DLL_vrfutil char *encode(const DtU32& val, char *buffer);
85  DT_DLL_vrfutil char *encode(const DtU64& val, char *buffer);
86  DT_DLL_vrfutil char *encode(const DtFloat32& val, char *buffer);
87  DT_DLL_vrfutil char *encode(const DtFloat64& val, char *buffer);
88  DT_DLL_vrfutil char *encode(const DtVector& val, char *buffer);
89  DT_DLL_vrfutil char *encode(const DtSphere& val, char *buffer);
90  DT_DLL_vrfutil char *encode(const DtTaitBryan& val, char *buffer);
91  DT_DLL_vrfutil char *encode(const bool& val, char *buffer);
92  DT_DLL_vrfutil char *encode(const DtObjectType& val, char *buffer);
93  DT_DLL_vrfutil char *encode(const std::vector<char>& val, char *buffer);
94  DT_DLL_vrfutil char *encode(const DtRwBoolean& val, char *buffer);
95  DT_DLL_vrfutil char *encode(const DtEntityType& val, char *buffer);
96  DT_DLL_vrfutil char *encode(const DtEntityIdentifier& val, char *buffer);
97  DT_DLL_vrfutil char *encode(const DtSimulationAddress& val, char *buffer);
98  DT_DLL_vrfutil char *encode(const DtAppearance& val, char *buffer);
99  DT_DLL_vrfutil char *encode(const DtForceType& val, char *buffer);
100  DT_DLL_vrfutil char *encode(const DtInetAddr& val, char *buffer);
101  DT_DLL_vrfutil char *encode(const DtRwInt& val, char* buffer);
102  DT_DLL_vrfutil char *encode(const DtRwVariableBindings& val, char* buffer);
103  DT_DLL_vrfutil char *encode(const DtRwTranslatableStringObject& val, char* buffer);
104  DT_DLL_vrfutil char *encode(const DtRwObjectType& val, char* buffer);
105  DT_DLL_vrfutil char *encode(const DtRwStringList& val, char* buffer);
106  DT_DLL_vrfutil char *encode(const DtRwIntegerList& val, char* buffer);
107  DT_DLL_vrfutil char *encode(const DtUUID& val, char* buffer);
108  DT_DLL_vrfutil char *encode(const DtRwUUID& val, char* buffer);
109  DT_DLL_vrfutil char *encode(const DtRwNLengthStringVector& val, char* buffer);
110  DT_DLL_vrfutil char *encode(const DtRwNLengthUUIDVector& val, char* buffer);
111  DT_DLL_vrfutil char *encode(const DtRwJoystickControl& val, char* buffer);
112  DT_DLL_vrfutil char *encode(const DtRwPlanVariable& val, char* buffer);
113  DT_DLL_vrfutil char *encode(const DtRwPlanSimulationObject& val, char* buffer);
114  DT_DLL_vrfutil char *encode(const DtRwOrbatData& val, char *buffer);
115 
116  template <typename T>
117  char* encode(const std::vector<T>& val, char* buffer);
118  template <typename T>
119  char* encode(const std::set<T>& val, char* buffer);
120  template <typename T>
121  char* encode(const std::list<T>& val, char* buffer);
122  template <typename T1, typename T2>
123  char* encode(const std::map<T1, T2>& val, char* buffer);
124  template <typename T1, typename T2>
125  char* encode(const boost::unordered_map<T1, T2>& val, char* buffer);
126  template <typename T1>
127  char* encode(const boost::unordered_set<T1>& val, char* buffer);
128  template <typename T1, typename T2>
129  char* encode(const std::pair<T1, T2>& val, char* buffer);
130 
131  //specialized version of decode for std::vector<bool> due to problems with c++
132  //standard on how vector<bool> is defined
133  DT_DLL_vrfutil char *encode(const std::vector<bool>& val, char *buffer);
135 
136 
144 
145  DT_DLL_vrfutil const char *decode(DtString& val, const char *buffer) ;
146  DT_DLL_vrfutil const char *decode(std::string& val, const char *buffer) ;
147  DT_DLL_vrfutil const char *decode(DtFilename& val, const char *buffer) ;
148  DT_DLL_vrfutil const char *decode(int& val, const char *buffer);
149  DT_DLL_vrfutil const char *decode(DtInt16& val, const char *buffer);
150 #ifndef DT_HAVE_64BIT_LONGS
151  DT_DLL_vrfutil const char *decode(DtInt32& val, const char *buffer);
152 #endif
153  DT_DLL_vrfutil const char *decode(DtU8& val, const char *buffer) ;
154  DT_DLL_vrfutil const char *decode(DtU16& val, const char *buffer) ;
155  DT_DLL_vrfutil const char *decode(DtU32& val, const char *buffer) ;
156  DT_DLL_vrfutil const char *decode(DtU64& val, const char *buffer) ;
157  DT_DLL_vrfutil const char *decode(DtFloat32& val, const char *buffer) ;
158  DT_DLL_vrfutil const char *decode(DtFloat64& val, const char *buffer) ;
159  DT_DLL_vrfutil const char *decode(DtVector& val, const char *buffer) ;
160  DT_DLL_vrfutil const char *decode(DtSphere& val, const char *buffer) ;
161  DT_DLL_vrfutil const char *decode(DtTaitBryan& val, const char *buffer) ;
162  DT_DLL_vrfutil const char *decode(bool &val, const char *buffer) ;
163  DT_DLL_vrfutil const char *decode(DtObjectType &val, const char *buffer) ;
164  DT_DLL_vrfutil const char *decode(std::vector<char>& val, const char *buffer) ;
165  DT_DLL_vrfutil const char *decode(DtRwBoolean &val, const char *buffer) ;
166  DT_DLL_vrfutil const char *decode(DtEntityType& val, const char *buffer);
167  DT_DLL_vrfutil const char *decode(DtEntityIdentifier& val, const char *buffer);
168  DT_DLL_vrfutil const char *decode(DtSimulationAddress& val, const char *buffer);
169  DT_DLL_vrfutil const char *decode(DtAppearance& val, const char *buffer);
170  DT_DLL_vrfutil const char *decode(DtForceType& val, const char *buffer);
171  DT_DLL_vrfutil const char *decode(DtInetAddr& val, const char *buffer);
172  DT_DLL_vrfutil const char *decode(DtRwInt& val, const char *buffer);
173  DT_DLL_vrfutil const char *decode(DtRwObjectType& val, const char *buffer);
174  DT_DLL_vrfutil const char *decode(DtRwStringList& val, const char *buffer);
175  DT_DLL_vrfutil const char *decode(DtRwIntegerList& val, const char *buffer);
176  DT_DLL_vrfutil const char *decode(DtUUID& val, const char *buffer);
177  DT_DLL_vrfutil const char *decode(DtRwUUID& val, const char *buffer);
178  DT_DLL_vrfutil const char *decode(DtRwNLengthStringVector& val, const char *buffer);
179  DT_DLL_vrfutil const char *decode(DtRwNLengthUUIDVector& val, const char *buffer);
180  DT_DLL_vrfutil const char *decode(DtRwVariableBindings& val, const char *buffer);
181  DT_DLL_vrfutil const char *decode(DtRwTranslatableStringObject& val, const char *buffer);
182  DT_DLL_vrfutil const char *decode(DtRwJoystickControl& val, const char *buffer);
183  DT_DLL_vrfutil const char *decode(DtRwPlanVariable& val, const char *buffer);
184  DT_DLL_vrfutil const char *decode(DtRwPlanSimulationObject& val, const char *buffer);
185  DT_DLL_vrfutil const char *decode(DtRwOrbatData& val, const char *buffer);
186 
187  template <typename T>
188  const char *decode(std::vector<T>& val, const char *buffer);
189  template <typename T>
190  const char *decode(std::set<T>& val, const char *buffer);
191  template <typename T>
192  const char *decode(std::list<T>& val, const char *buffer);
193  template <typename T1, typename T2>
194  const char *decode(std::map<T1, T2>& val, const char *buffer);
195  template <typename T1, typename T2>
196  const char *decode(boost::unordered_map<T1, T2>& val, const char *buffer);
197  template <typename T1>
198  const char *decode(boost::unordered_set<T1>& val, const char *buffer);
199  template <typename T1, typename T2>
200  const char *decode(std::pair<T1, T2>& val, const char *buffer);
201 
202  //specialized version of decode for std::vector<bool> due to problems with c++
203  //standard on how vector<bool> is defined
204  DT_DLL_vrfutil const char *decode(std::vector<bool>& val, const char *buffer);
205 
208  DT_DLL_vrfutil const char *decode(std::vector<DtUUID>& val, const char *buffer);
209  DT_DLL_vrfutil const char *decode(boost::unordered_map<DtUUID, DtUUID>& val, const char *buffer);
210  DT_DLL_vrfutil const char *decode(boost::unordered_set<DtUUID>& val, const char *buffer);
211  DT_DLL_vrfutil const char *decode(std::set<DtUUID>& val, const char *buffer);
213 
217 
219  DT_DLL_vrfutil int getSize(const DtString& val) ;
220  DT_DLL_vrfutil int getSize(const std::string& val);
221  DT_DLL_vrfutil int getSize(const DtFilename& val) ;
222  DT_DLL_vrfutil int getSize(const DtVector& v) ;
223  DT_DLL_vrfutil int getSize(const DtSphere& v) ;
224  DT_DLL_vrfutil int getSize(const int& v);
225  DT_DLL_vrfutil int getSize(const DtInt16& v);
226 #ifndef DT_HAVE_64BIT_LONGS
227  DT_DLL_vrfutil int getSize(const DtInt32& v);
228 #endif
229  DT_DLL_vrfutil int getSize(const DtU8& v) ;
230  DT_DLL_vrfutil int getSize(const DtU16& v) ;
231  DT_DLL_vrfutil int getSize(const DtU32& v) ;
232  DT_DLL_vrfutil int getSize(const DtU64& v) ;
233  DT_DLL_vrfutil int getSize(const DtFloat32& v) ;
234  DT_DLL_vrfutil int getSize(const DtFloat64& v) ;
235  DT_DLL_vrfutil int getSize(const bool&v) ;
236  DT_DLL_vrfutil int getSize(const DtObjectType& v) ;
237  DT_DLL_vrfutil int getSize(const DtTaitBryan& v) ;
238  DT_DLL_vrfutil int getSize(const std::vector<char>& v) ;
239  DT_DLL_vrfutil int getSize(const DtRwBoolean& v) ;
240  DT_DLL_vrfutil int getSize(const DtEntityType& v);
241  DT_DLL_vrfutil int getSize(const DtEntityIdentifier& v);
242  DT_DLL_vrfutil int getSize(const DtSimulationAddress& v);
243  DT_DLL_vrfutil int getSize(const DtAppearance& v);
244  DT_DLL_vrfutil int getSize(const DtForceType& v);
245  DT_DLL_vrfutil int getSize(const DtInetAddr& v);
246  DT_DLL_vrfutil int getSize(const DtRwInt& v);
247  DT_DLL_vrfutil int getSize(const DtRwObjectType& v);
250  DT_DLL_vrfutil int getSize(const DtRwStringList& v);
251  DT_DLL_vrfutil int getSize(const DtRwIntegerList& v);
252  DT_DLL_vrfutil int getSize(const DtUUID& v);
253  DT_DLL_vrfutil int getSize(const DtRwUUID& v);
258  DT_DLL_vrfutil int getSize(const DtRwOrbatData& v);
259 
260  template <typename T>
261  int getSize(const std::vector<T>& v) ;
262  template <typename T>
263  int getSize(const std::list<T>& v) ;
264  template <typename T1, typename T2>
265  int getSize(const std::map<T1, T2>& v) ;
266  template <typename T1, typename T2>
267  int getSize(const boost::unordered_map<T1, T2>& v) ;
268  template <typename T1>
269  int getSize(const boost::unordered_set<T1>& v) ;
270  template <typename T1, typename T2>
271  int getSize(const std::pair<T1, T2>& v) ;
272  template <typename T>
273  int getSize(const std::set<T>& v) ;
274 
275  //specialized version of decode for std::vector<bool> due to problems with c++
276  //standard on how vector<bool> is defined
277  DT_DLL_vrfutil int getSize(const std::vector<bool>& v);
279 
282  DT_DLL_vrfutil int getSize(const DtSimInterfaceContent* const& contentPtr);
283 
288  DT_DLL_vrfutil char *encode(const DtSimInterfaceContent* const& adminContentPtr, char *buffer);
289 
298  DT_DLL_vrfutil const char *decode(DtSimInterfaceContent*& interfaceContentPtr, const char *buffer);
299 }
300 
301 #define bufferSerialize_INL_
302 #include "vrfutil/bufferSerialize.inl"
303 #undef bufferSerialize_INL_
304 

Document ID: Generated on Thu Apr 12 03:15:37 EDT 2018 from SVN revision 187986
Copyright © 2005-2018 VT MÄK. All Rights Reserved (www.mak.com)