source: rrlib_rtti_conversion/defined_conversions.cpp @ 7:4cc15587a7e6

17.03
Last change on this file since 7:4cc15587a7e6 was 7:4cc15587a7e6, checked in by Max Reichardt <mreichardt@…>, 22 months ago

Adds support for std::array types - tohether with additional type conversion operations

File size: 26.4 KB
Line 
1//
2// You received this file as part of RRLib
3// Robotics Research Library
4//
5// Copyright (C) Finroc GbR (finroc.org)
6//
7// This program is free software; you can redistribute it and/or modify
8// it under the terms of the GNU General Public License as published by
9// the Free Software Foundation; either version 2 of the License, or
10// (at your option) any later version.
11//
12// This program is distributed in the hope that it will be useful,
13// but WITHOUT ANY WARRANTY; without even the implied warranty of
14// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15// GNU General Public License for more details.
16//
17// You should have received a copy of the GNU General Public License along
18// with this program; if not, write to the Free Software Foundation, Inc.,
19// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20//
21//----------------------------------------------------------------------
22/*!\file    rrlib/rtti_conversion/defined_conversions.cpp
23 *
24 * \author  Max Reichardt
25 *
26 * \date    2016-08-13
27 *
28 */
29//----------------------------------------------------------------------
30#include "rrlib/rtti_conversion/defined_conversions.h"
31
32//----------------------------------------------------------------------
33// External includes (system with <>, local with "")
34//----------------------------------------------------------------------
35#include <iomanip>
36
37//----------------------------------------------------------------------
38// Internal includes with ""
39//----------------------------------------------------------------------
40#include "rrlib/rtti_conversion/tStaticCastOperation.h"
41#include "rrlib/rtti_conversion/definition/tVoidFunctionConversionOperation.h"
42
43//----------------------------------------------------------------------
44// Debugging
45//----------------------------------------------------------------------
46#include <cassert>
47
48//----------------------------------------------------------------------
49// Namespace usage
50//----------------------------------------------------------------------
51
52//----------------------------------------------------------------------
53// Namespace declaration
54//----------------------------------------------------------------------
55namespace rrlib
56{
57namespace rtti
58{
59namespace conversion
60{
61
62//----------------------------------------------------------------------
63// Forward declarations / typedefs / enums
64//----------------------------------------------------------------------
65
66//----------------------------------------------------------------------
67// Const values
68//----------------------------------------------------------------------
69
70// Register static casts between builtin types
71auto& cBUILTIN_TYPE_CASTS = tStaticCastOperation::
72                            Register<int8_t, int16_t, true, true>()
73                            .Register<int8_t, int32_t, true, true>()
74                            .Register<int8_t, int64_t, true, true>()
75                            .Register<int8_t, uint8_t, true, true>()
76                            .Register<int8_t, uint16_t, true, true>()
77                            .Register<int8_t, uint32_t, true, true>()
78                            .Register<int8_t, uint64_t, true, true>()
79                            .Register<int8_t, float, true, true>()
80                            .Register<int8_t, double, true, true>()
81                            .Register<int8_t, bool, true, true>()
82
83                            .Register<int16_t, int32_t, true, true>()
84                            .Register<int16_t, int64_t, true, true>()
85                            .Register<int16_t, uint8_t, true, true>()
86                            .Register<int16_t, uint16_t, true, true>()
87                            .Register<int16_t, uint32_t, true, true>()
88                            .Register<int16_t, uint64_t, true, true>()
89                            .Register<int16_t, float, true, true>()
90                            .Register<int16_t, double, true, true>()
91                            .Register<int16_t, bool, true, true>()
92
93                            .Register<int32_t, int64_t, true, true>()
94                            .Register<int32_t, uint8_t, true, true>()
95                            .Register<int32_t, uint16_t, true, true>()
96                            .Register<int32_t, uint32_t, true, true>()
97                            .Register<int32_t, uint64_t, true, true>()
98                            .Register<int32_t, float, true, true>()
99                            .Register<int32_t, double, true, true>()
100                            .Register<int32_t, bool, true, true>()
101
102                            .Register<int64_t, uint8_t, true, true>()
103                            .Register<int64_t, uint16_t, true, true>()
104                            .Register<int64_t, uint32_t, true, true>()
105                            .Register<int64_t, uint64_t, true, true>()
106                            .Register<int64_t, float, true, true>()
107                            .Register<int64_t, double, true, true>()
108                            .Register<int64_t, bool, true, true>()
109
110                            .Register<uint8_t, uint16_t, true, true>()
111                            .Register<uint8_t, uint32_t, true, true>()
112                            .Register<uint8_t, uint64_t, true, true>()
113                            .Register<uint8_t, float, true, true>()
114                            .Register<uint8_t, double, true, true>()
115                            .Register<uint8_t, bool, true, true>()
116
117                            .Register<uint16_t, uint32_t, true, true>()
118                            .Register<uint16_t, uint64_t, true, true>()
119                            .Register<uint16_t, float, true, true>()
120                            .Register<uint16_t, double, true, true>()
121                            .Register<uint16_t, bool, true, true>()
122
123                            .Register<uint32_t, uint64_t, true, true>()
124                            .Register<uint32_t, float, true, true>()
125                            .Register<uint32_t, double, true, true>()
126                            .Register<uint32_t, bool, true, true>()
127
128                            .Register<uint64_t, float, true, true>()
129                            .Register<uint64_t, double, true, true>()
130                            .Register<uint64_t, bool, true, true>()
131
132                            .Register<float, double, true, true>()
133                            .Register<float, bool, true, true>()
134
135                            .Register<double, bool, true, true>()
136
137                            .Register<rrlib::serialization::tMemoryBuffer, std::vector<uint8_t>>();
138
139//----------------------------------------------------------------------
140// Implementation
141//----------------------------------------------------------------------
142
143namespace
144{
145
146class tToStringOperation : public tRegisteredConversionOperation
147{
148public:
149  tToStringOperation() : tRegisteredConversionOperation(util::tManagedConstCharPointer("ToString", false), tSupportedTypeFilter::STRING_SERIALIZABLE, tDataType<std::string>(), nullptr, tParameterDefinition("Flags", tDataType<unsigned int>(), true))
150  {}
151
152  virtual tConversionOption GetConversionOption(const tType& source_type, const tType& destination_type, const tGenericObject* parameter) const override
153  {
154    if ((source_type.GetTypeTraits() & trait_flags::cIS_STRING_SERIALIZABLE) && destination_type == tDataType<std::string>())
155    {
156      return tConversionOption(source_type, destination_type, false, &FirstConversionFunction, &FinalConversionFunction);
157    }
158    return tConversionOption();
159  }
160
161  static void MainConversionFunction(const tTypedConstPointer& source_object, std::string& destination, const tCurrentConversionOperation& operation)
162  {
163    rrlib::serialization::tStringOutputStream stream;
164
165    // init stream
166    /*auto precision = operation.GetParameterValue(0);
167    if (precision)
168    {
169      stream.GetWrappedStringStream() << std::setprecision(*precision.Get<int>());
170    }*/
171    auto flags = operation.GetParameterValue();
172    if (flags)
173    {
174      unsigned int f = *flags.Get<unsigned int>();
175      if (f)
176      {
177        if (f & eTSF_BOOL_ALPHA)
178        {
179          stream.GetWrappedStringStream() << std::boolalpha;
180        }
181        if (f & eTSF_SHOW_BASE)
182        {
183          stream.GetWrappedStringStream() << std::showbase;
184        }
185        if (f & eTSF_SHOW_POINT)
186        {
187          stream.GetWrappedStringStream() << std::showpoint;
188        }
189        if (f & eTSF_SHOW_POS)
190        {
191          stream.GetWrappedStringStream() << std::showpos;
192        }
193        if (f & eTSF_UPPER_CASE)
194        {
195          stream.GetWrappedStringStream() << std::uppercase;
196        }
197        if (f & eTSF_DEC)
198        {
199          stream.GetWrappedStringStream() << std::dec;
200        }
201        if (f & eTSF_HEX)
202        {
203          stream.GetWrappedStringStream() << std::hex;
204        }
205        if (f & eTSF_OCT)
206        {
207          stream.GetWrappedStringStream() << std::oct;
208        }
209        if (f & eTSF_FIXED)
210        {
211          stream.GetWrappedStringStream() << std::fixed;
212        }
213        if (f & eTSF_SCIENTIFIC)
214        {
215          stream.GetWrappedStringStream() << std::scientific;
216        }
217      }
218    }
219
220    source_object.Serialize(stream);
221    destination = stream.ToString();
222  }
223
224  static void FirstConversionFunction(const tTypedConstPointer& source_object, const tTypedPointer& destination_object, const tCurrentConversionOperation& operation)
225  {
226    std::string intermediate;
227    MainConversionFunction(source_object, intermediate, operation);
228    operation.Continue(tTypedConstPointer(&intermediate), destination_object);
229  }
230
231  static void FinalConversionFunction(const tTypedConstPointer& source_object, const tTypedPointer& destination_object, const tCurrentConversionOperation& operation)
232  {
233    MainConversionFunction(source_object, *destination_object.Get<std::string>(), operation);
234  }
235};
236
237class tStringDeserializationOperation : public tRegisteredConversionOperation
238{
239public:
240  tStringDeserializationOperation() : tRegisteredConversionOperation(util::tManagedConstCharPointer("String Deserialization", false), tDataType<std::string>(), tSupportedTypeFilter::STRING_SERIALIZABLE)
241  {}
242
243  virtual tConversionOption GetConversionOption(const tType& source_type, const tType& destination_type, const tGenericObject* parameter) const override
244  {
245    if ((destination_type.GetTypeTraits() & trait_flags::cIS_STRING_SERIALIZABLE) && source_type == tDataType<std::string>())
246    {
247      return tConversionOption(source_type, destination_type, false, &FirstConversionFunction, &FinalConversionFunction);
248    }
249    return tConversionOption();
250  }
251
252  static void FirstConversionFunction(const tTypedConstPointer& source_object, const tTypedPointer& destination_object, const tCurrentConversionOperation& operation)
253  {
254    tType inter_type = operation.compiled_operation.IntermediateType();
255    char intermediate_memory[inter_type.GetSize(true)];
256    auto intermediate_object = inter_type.EmplaceGenericObject(intermediate_memory);
257    serialization::tStringInputStream stream(*source_object.Get<std::string>());
258    intermediate_object->Deserialize(stream);
259    operation.Continue(*intermediate_object, destination_object);
260  }
261
262  static void FinalConversionFunction(const tTypedConstPointer& source_object, const tTypedPointer& destination_object, const tCurrentConversionOperation& operation)
263  {
264    serialization::tStringInputStream stream(*source_object.Get<std::string>());
265    destination_object.Deserialize(stream);
266  }
267};
268
269class tBinarySerializationOperation : public tRegisteredConversionOperation
270{
271public:
272  tBinarySerializationOperation() : tRegisteredConversionOperation(util::tManagedConstCharPointer("Binary Serialization", false), tSupportedTypeFilter::BINARY_SERIALIZABLE, tDataType<serialization::tMemoryBuffer>())
273  {}
274
275  virtual tConversionOption GetConversionOption(const tType& source_type, const tType& destination_type, const tGenericObject* parameter) const override
276  {
277    if ((source_type.GetTypeTraits() & trait_flags::cIS_BINARY_SERIALIZABLE) && destination_type == tDataType<serialization::tMemoryBuffer>())
278    {
279      return tConversionOption(source_type, destination_type, false, &FirstConversionFunction, &FinalConversionFunction);
280    }
281    return tConversionOption();
282  }
283
284  static void FirstConversionFunction(const tTypedConstPointer& source_object, const tTypedPointer& destination_object, const tCurrentConversionOperation& operation)
285  {
286    serialization::tStackMemoryBuffer<serialization::cSTACK_BUFFERS_SIZE> buffer;
287    rrlib::serialization::tOutputStream stream(buffer);
288    source_object.Serialize(stream);
289    stream.Close();
290    operation.Continue(tTypedConstPointer(&static_cast<serialization::tMemoryBuffer&>(buffer)), destination_object);
291  }
292
293  static void FinalConversionFunction(const tTypedConstPointer& source_object, const tTypedPointer& destination_object, const tCurrentConversionOperation& operation)
294  {
295    serialization::tOutputStream stream(*destination_object.Get<serialization::tMemoryBuffer>());
296    destination_object.Serialize(stream);
297  }
298};
299
300class tBinaryDeserializationOperation : public tRegisteredConversionOperation
301{
302public:
303  tBinaryDeserializationOperation() : tRegisteredConversionOperation(util::tManagedConstCharPointer("Binary Deserialization", false), tDataType<serialization::tMemoryBuffer>(), tSupportedTypeFilter::STRING_SERIALIZABLE)
304  {}
305
306  virtual tConversionOption GetConversionOption(const tType& source_type, const tType& destination_type, const tGenericObject* parameter) const override
307  {
308    if ((destination_type.GetTypeTraits() & trait_flags::cIS_BINARY_SERIALIZABLE) && source_type == tDataType<serialization::tMemoryBuffer>())
309    {
310      return tConversionOption(source_type, destination_type, false, &FirstConversionFunction, &FinalConversionFunction);
311    }
312    return tConversionOption();
313  }
314
315  static void FirstConversionFunction(const tTypedConstPointer& source_object, const tTypedPointer& destination_object, const tCurrentConversionOperation& operation)
316  {
317    tType inter_type = operation.compiled_operation.IntermediateType();
318    char intermediate_memory[inter_type.GetSize(true)];
319    auto intermediate_object = inter_type.EmplaceGenericObject(intermediate_memory);
320    serialization::tInputStream stream(*source_object.Get<serialization::tMemoryBuffer>());
321    intermediate_object->Deserialize(stream);
322    operation.Continue(*intermediate_object, destination_object);
323  }
324
325  static void FinalConversionFunction(const tTypedConstPointer& source_object, const tTypedPointer& destination_object, const tCurrentConversionOperation& operation)
326  {
327    serialization::tInputStream stream(*source_object.Get<serialization::tMemoryBuffer>());
328    destination_object.Deserialize(stream);
329  }
330};
331
332class tGetListElement : public tRegisteredConversionOperation
333{
334public:
335  tGetListElement() : tRegisteredConversionOperation(util::tManagedConstCharPointer("[]", false), tSupportedTypeFilter::GET_LIST_ELEMENT, tSupportedTypeFilter::GET_LIST_ELEMENT, nullptr, tParameterDefinition("Index", tDataType<unsigned int>(), true))
336  {}
337
338  virtual tConversionOption GetConversionOption(const tType& source_type, const tType& destination_type, const tGenericObject* parameter) const override
339  {
340    if (source_type.IsListType() && source_type.GetElementType() == destination_type)
341    {
342      return tConversionOption(source_type, destination_type, &FirstConversionFunction, &GetDestinationReference);
343    }
344    return tConversionOption();
345  }
346
347  static tTypedConstPointer GetDestinationReference(const tTypedConstPointer& source_object, const tCurrentConversionOperation& operation)
348  {
349    auto index_parameter = operation.GetParameterValue();
350    unsigned int index = index_parameter ? (*index_parameter.Get<unsigned int>()) : 0;
351    auto result = source_object.GetVectorElement(index);
352    if (!result)
353    {
354      throw std::invalid_argument("Index out of bounds");
355    }
356    return result;
357  }
358
359  static void FirstConversionFunction(const tTypedConstPointer& source_object, const tTypedPointer& destination_object, const tCurrentConversionOperation& operation)
360  {
361    auto index_parameter = operation.GetParameterValue();
362    unsigned int index = index_parameter ? (*index_parameter.Get<unsigned int>()) : 0;
363    auto intermediate = source_object.GetVectorElement(index);
364    if (!intermediate)
365    {
366      throw std::invalid_argument("Index out of bounds");
367    }
368    operation.Continue(intermediate, destination_object);
369  }
370};
371
372class tForEach : public tRegisteredConversionOperation
373{
374public:
375  tForEach() : tRegisteredConversionOperation(util::tManagedConstCharPointer("For Each", false), tSupportedTypeFilter::GENERIC_VECTOR_CAST, tSupportedTypeFilter::GENERIC_VECTOR_CAST)
376  {}
377
378  virtual tConversionOption GetConversionOption(const tType& source_type, const tType& destination_type, const tGenericObject* parameter) const override
379  {
380    if ((source_type.GetTypeTraits() & trait_flags::cIS_LIST_TYPE) && destination_type)
381    {
382      return tConversionOption(source_type, destination_type, false, &FirstConversionFunction, &FinalConversionFunction);
383    }
384    return tConversionOption();
385  }
386
387  static void FirstConversionFunction(const tTypedConstPointer& source_object, const tTypedPointer& destination_object, const tCurrentConversionOperation& operation)
388  {
389    size_t size = source_object.GetVectorSize();
390    destination_object.ResizeVector(size);
391    if (size)
392    {
393      tTypedConstPointer source_first = source_object.GetVectorElement(0);
394      tTypedPointer destination_first = destination_object.GetVectorElement(0);
395      operation.Continue(source_first, destination_object);
396      if (size > 1)
397      {
398        tTypedConstPointer source_next = source_object.GetVectorElement(1);
399        tTypedPointer destination_next = destination_object.GetVectorElement(1);
400        operation.Continue(source_next, destination_next);
401        size_t offset_source = static_cast<const char*>(source_next.GetRawDataPointer()) - static_cast<const char*>(source_first.GetRawDataPointer());
402        size_t offset_destination = static_cast<const char*>(destination_next.GetRawDataPointer()) - static_cast<const char*>(destination_first.GetRawDataPointer());
403        for (size_t i = 2; i < size; i++)
404        {
405          source_next = tTypedConstPointer(static_cast<const char*>(source_next.GetRawDataPointer()) + offset_source, source_next.GetType());
406          destination_next = tTypedPointer(static_cast<char*>(destination_next.GetRawDataPointer()) + offset_destination, destination_next.GetType());
407          operation.Continue(source_next, destination_next);
408        }
409      }
410    }
411  }
412
413  static void FinalConversionFunction(const tTypedConstPointer& source_object, const tTypedPointer& destination_object, const tCurrentConversionOperation& operation)
414  {
415    throw std::logic_error("Not supported as single or second operation");
416  }
417};
418
419class tGetArrayElement : public tRegisteredConversionOperation
420{
421public:
422  tGetArrayElement() : tRegisteredConversionOperation(util::tManagedConstCharPointer("[]", false), tSupportedTypeFilter::GET_ARRAY_ELEMENT, tSupportedTypeFilter::GET_ARRAY_ELEMENT, nullptr, tParameterDefinition("Index", tDataType<unsigned int>(), true))
423  {}
424
425  virtual tConversionOption GetConversionOption(const tType& source_type, const tType& destination_type, const tGenericObject* parameter) const override
426  {
427    unsigned int index = parameter ? parameter->GetData<unsigned int>() : 0;
428    if (source_type.IsArray() && source_type.GetElementType() == destination_type && index < source_type.GetArraySize())
429    {
430      return tConversionOption(source_type, destination_type, index * source_type.GetElementType().GetSize());
431    }
432    return tConversionOption();
433  }
434};
435
436class tForEachArray : public tRegisteredConversionOperation
437{
438public:
439  tForEachArray() : tRegisteredConversionOperation(util::tManagedConstCharPointer("For Each", false), tSupportedTypeFilter::GENERIC_ARRAY_CAST, tSupportedTypeFilter::GENERIC_ARRAY_CAST)
440  {}
441
442  virtual tConversionOption GetConversionOption(const tType& source_type, const tType& destination_type, const tGenericObject* parameter) const override
443  {
444    if ((source_type.GetTypeTraits() & trait_flags::cIS_ARRAY) && destination_type)
445    {
446      return tConversionOption(source_type, destination_type, false, &FirstConversionFunction, &FinalConversionFunction);
447    }
448    return tConversionOption();
449  }
450
451  static void FirstConversionFunction(const tTypedConstPointer& source_object, const tTypedPointer& destination_object, const tCurrentConversionOperation& operation)
452  {
453    tType source_type = source_object.GetType();
454    tType destination_type = destination_object.GetType();
455    size_t size = source_type.GetArraySize();
456    if (size != destination_type.GetArraySize())
457    {
458      throw std::runtime_error("Arrays must have the same size");
459    }
460
461    size_t source_element_offset = source_type.GetSize() / size;
462    size_t destination_element_offset = destination_type.GetSize() / size;
463    for (size_t i = 0; i < size; i++)
464    {
465      tTypedConstPointer source(static_cast<const char*>(source_object.GetRawDataPointer()) + i * source_element_offset, source_type);
466      tTypedPointer destination(static_cast<char*>(destination_object.GetRawDataPointer()) + i * destination_element_offset, destination_type);
467      operation.Continue(source, destination);
468    }
469  }
470
471  static void FinalConversionFunction(const tTypedConstPointer& source_object, const tTypedPointer& destination_object, const tCurrentConversionOperation& operation)
472  {
473    throw std::logic_error("Not supported as single or second operation");
474  }
475};
476
477class tWrapByteVectorOperation : public tRegisteredConversionOperation
478{
479public:
480  tWrapByteVectorOperation() : tRegisteredConversionOperation(util::tManagedConstCharPointer("Wrap", false), tDataType<std::vector<uint8_t>>(), tDataType<rrlib::serialization::tMemoryBuffer>(), &cCONVERSION_OPTION)
481  {}
482
483  static void FirstConversionFunction(const tTypedConstPointer& source_object, const tTypedPointer& destination_object, const tCurrentConversionOperation& operation)
484  {
485    const std::vector<uint8_t>& vector = *source_object.Get<std::vector<uint8_t>>();
486    if (vector.size())
487    {
488      const rrlib::serialization::tMemoryBuffer buffer(const_cast<uint8_t*>(&vector[0]), vector.size());
489      operation.Continue(tTypedConstPointer(&buffer), destination_object);
490    }
491    else
492    {
493      const rrlib::serialization::tMemoryBuffer buffer(0);
494      operation.Continue(tTypedConstPointer(&buffer), destination_object);
495    }
496  }
497
498  static void FinalConversionFunction(const tTypedConstPointer& source_object, const tTypedPointer& destination_object, const tCurrentConversionOperation& operation)
499  {
500    rrlib::serialization::tMemoryBuffer& buffer = *destination_object.Get<rrlib::serialization::tMemoryBuffer>();
501    const std::vector<uint8_t>& vector = *source_object.Get<std::vector<uint8_t>>();
502    const rrlib::serialization::tMemoryBuffer temp_buffer(const_cast<uint8_t*>(&vector[0]), vector.size());
503    buffer.CopyFrom(temp_buffer);
504  }
505
506  static constexpr tConversionOption cCONVERSION_OPTION = tConversionOption(tDataType<std::vector<uint8_t>>(), tDataType<rrlib::serialization::tMemoryBuffer>(), false, &FirstConversionFunction, &FinalConversionFunction);
507};
508
509constexpr tConversionOption tWrapByteVectorOperation::cCONVERSION_OPTION;
510
511class tListSize : public tRegisteredConversionOperation
512{
513public:
514  tListSize() : tRegisteredConversionOperation(util::tManagedConstCharPointer("size()", false), tSupportedTypeFilter::LISTS, tDataType<size_t>())
515  {}
516
517  virtual tConversionOption GetConversionOption(const tType& source_type, const tType& destination_type, const tGenericObject* parameter) const override
518  {
519    if (source_type.IsListType() && destination_type == tDataType<size_t>())
520    {
521      return tConversionOption(source_type, destination_type, false, &FirstConversionFunction, &FinalConversionFunction);
522    }
523    return tConversionOption();
524  }
525
526  static void FirstConversionFunction(const tTypedConstPointer& source_object, const tTypedPointer& destination_object, const tCurrentConversionOperation& operation)
527  {
528    size_t size = source_object.GetVectorSize();
529    operation.Continue(tTypedConstPointer(&size), destination_object);
530  }
531
532  static void FinalConversionFunction(const tTypedConstPointer& source_object, const tTypedPointer& destination_object, const tCurrentConversionOperation& operation)
533  {
534    (*destination_object.Get<size_t>()) = source_object.GetVectorSize();
535  }
536};
537
538void StringToVectorConversionFunction(const std::string& source, std::vector<char>& destination)
539{
540  destination = std::vector<char>(source.begin(), source.end());
541}
542
543void VectorToStringConversionFunction(const std::vector<char>& source, std::string& destination)
544{
545  destination = std::string(source.begin(), source.end());
546}
547
548
549const tToStringOperation cTO_STRING;
550const tStringDeserializationOperation cSTRING_DESERIALIZATION;
551const tBinarySerializationOperation cBINARY_SERIALIZATION;
552const tBinaryDeserializationOperation cBINARY_DESERIALIZATION;
553const tGetListElement cGET_LIST_ELEMENT;
554const tForEach cFOR_EACH;
555const tGetArrayElement cGET_ARRAY_ELEMENT;
556const tForEachArray cFOR_EACH_ARRAY;
557const tWrapByteVectorOperation cWRAP_BYTE_VECTOR;
558const tListSize cLIST_SIZE;
559const tVoidFunctionConversionOperation<std::string, std::vector<char>, decltype(&StringToVectorConversionFunction), &StringToVectorConversionFunction> cSTRING_TO_VECTOR("ToVector");
560const tVoidFunctionConversionOperation<std::vector<char>, std::string, decltype(&VectorToStringConversionFunction), &VectorToStringConversionFunction> cVECTOR_TO_STRING("MakeString");
561
562}
563
564const tRegisteredConversionOperation& cTO_STRING_OPERATION = cTO_STRING;
565const tRegisteredConversionOperation& cSTRING_DESERIALIZATION_OPERATION = cSTRING_DESERIALIZATION;
566const tRegisteredConversionOperation& cBINARY_SERIALIZATION_OPERATION = cBINARY_SERIALIZATION;
567const tRegisteredConversionOperation& cBINARY_DESERIALIZATION_OPERATION = cBINARY_DESERIALIZATION;
568const tRegisteredConversionOperation& cGET_LIST_ELEMENT_OPERATION = cGET_LIST_ELEMENT;
569const tRegisteredConversionOperation& cFOR_EACH_OPERATION = cFOR_EACH;
570const tRegisteredConversionOperation& cGET_ARRAY_ELEMENT_OPERATION = cGET_ARRAY_ELEMENT;
571const tRegisteredConversionOperation& cFOR_EACH_OPERATION_ARRAY = cFOR_EACH_ARRAY;
572const tRegisteredConversionOperation& cWRAP_BYTE_VECTOR_OPERATION = cWRAP_BYTE_VECTOR;
573const tRegisteredConversionOperation& cLIST_SIZE_OPERATION = cLIST_SIZE;
574const tRegisteredConversionOperation& cSTRING_TO_VECTOR_OPERATION = cSTRING_TO_VECTOR;
575const tRegisteredConversionOperation& cMAKE_STRING_OPERATION = cVECTOR_TO_STRING;
576
577
578
579//----------------------------------------------------------------------
580// End of namespace declaration
581//----------------------------------------------------------------------
582}
583}
584}
Note: See TracBrowser for help on using the repository browser.