33 #ifndef vtkVariantBoostSerialization_h
34 #define vtkVariantBoostSerialization_h
36 #include "vtkSetGet.h"
43 #include <boost/archive/binary_oarchive.hpp>
45 #include <boost/serialization/base_object.hpp>
46 #include <boost/serialization/export.hpp>
47 #include <boost/serialization/extended_type_info_no_rtti.hpp>
48 #include <boost/serialization/split_free.hpp>
53 template<
typename Archiver>
55 const unsigned int vtkNotUsed(
version))
57 ar & boost::serialization::base_object<std::string>(str);
64 template<
typename Archiver>
66 const unsigned int vtkNotUsed(
version))
72 template<
typename Archiver>
74 const unsigned int vtkNotUsed(
version))
88 template<typename Archiver>
90 const
unsigned int vtkNotUsed(
version))
92 if (!variant.IsValid())
100 char Type = variant.GetType();
104 #define VTK_VARIANT_SAVE(Value,Type,Function) \
107 Type value = variant.Function(); \
130 cerr <<
"cannot serialize variant with type " << variant.GetType()
133 #undef VTK_VARIANT_SAVE
136 template<
typename Archiver>
138 const unsigned int vtkNotUsed(
version))
143 #define VTK_VARIANT_LOAD(Value,Type) \
148 variant = vtkVariant(value); \
170 cerr <<
"cannot deserialize variant with type " <<
static_cast<unsigned int>(Type) <<
'\n';
173 #undef VTK_VARIANT_LOAD
182 template<typename Archiver>
184 const
unsigned int vtkNotUsed(
version))
202 template<
typename Archiver>
204 const unsigned int vtkNotUsed(
version))
Wrapper around std::string to keep symbols short.
#define VTK_VARIANT_SAVE(Value, Type, Function)
void load(Archiver &ar, vtkUnicodeString &str, const unsigned int vtkNotUsed(version))
void serialize(Archiver &ar, vtkStdString &str, const unsigned int vtkNotUsed(version))
An array holding vtkVariants.
vtkIdType GetNumberOfTuples()
Get the number of complete tuples (a component group) in the array.
#define VTK_UNSIGNED_SHORT
void SetNumberOfTuples(vtkIdType number) override
Set the number of tuples (a component group) in the array.
#define VTK_UNICODE_STRING
#define VTK_VARIANT_LOAD(Value, Type)
A atomic type representing the union of many types.
const std::string & ToString(TransportMethod)
virtual void SetName(const char *)
Set/get array's name.
static vtkUnicodeString from_utf8(const char *)
Constructs a string from a null-terminated sequence of UTF-8 encoded characters.
const char * utf8_str() const
Returns the sequence as a null-terminated sequence of UTF-8 encoded characters.
virtual char * GetName()
Set/get array's name.
void SetValue(vtkIdType id, vtkVariant value)
Set the data at a particular index.
void save(Archiver &ar, const vtkUnicodeString &str, const unsigned int vtkNotUsed(version))
#define VTK_UNSIGNED_CHAR
#define VTK_UNSIGNED_LONG
vtkVariant & GetValue(vtkIdType id) const
Get the data at a particular index.
#define VTK_UNSIGNED_LONG_LONG
String class that stores Unicode text.