BuiltinSerializer.h
Go to the documentation of this file.
1 /******************************************************************************
2  * Copyright (C) 2014 by Ralf Kaestner *
3  * ralf.kaestner@gmail.com *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the Lesser GNU General Public License as published by*
7  * the Free Software Foundation; either version 3 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * Lesser GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the Lesser GNU General Public License *
16  * along with this program. If not, see <http://www.gnu.org/licenses/>. *
17  ******************************************************************************/
18 
23 #ifndef VARIANT_TOPIC_TOOLS_BUILTIN_SERIALIZER_H
24 #define VARIANT_TOPIC_TOOLS_BUILTIN_SERIALIZER_H
25 
28 
29 namespace variant_topic_tools {
33  public Serializer {
34  friend class BuiltinDataType;
35  friend class BuiltinVariant;
36  public:
40 
44 
47  BuiltinSerializer(const Serializer& src);
48 
52 
53  protected:
56  class Impl :
57  public virtual Serializer::Impl {
58  public:
61  Impl();
62 
65  virtual ~Impl();
66  };
67 
71  template <typename T> class ImplT :
72  public Impl {
73  public:
74  BOOST_STATIC_ASSERT(type_traits::IsBuiltin<T>::value);
75 
79 
82  ImplT();
83 
86  virtual ~ImplT();
87 
91  size_t getSerializedLength(const Variant& value) const;
92 
95  void serialize(ros::serialization::OStream& stream, const
96  Variant& value);
97 
100  void deserialize(ros::serialization::IStream& stream, Variant& value);
101  };
102 
105  template <typename T> static BuiltinSerializer create();
106  };
107 };
108 
109 #include <variant_topic_tools/BuiltinSerializer.tpp>
110 
111 #endif
Header file providing the Serializer class interface.
Built-in data serializer implementation.
Header file providing the built-in type traits.
static BuiltinSerializer create()
Create a built-in serializer.
virtual size_t getSerializedLength(const Variant &value) const =0
Retrieve the serialized length of a variant value (abstract declaration)
virtual void deserialize(ros::serialization::IStream &stream, Variant &value)=0
Deserialize a variant value (abstract declaration)
Serializer implementation.
Definition: Serializer.h:88
virtual void serialize(ros::serialization::OStream &stream, const Variant &value)=0
Serialize a variant value (abstract declaration)
Built-in serializer implementation (templated strong-typed version)
type_traits::BuiltinType< T >::ValueType ValueType
Declaration of the value type.


variant_topic_tools
Author(s): Ralf Kaestner
autogenerated on Sat Jan 9 2021 03:56:49