 |
VTK
9.1.0
|
Go to the documentation of this file.
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>
56 ar& boost::serialization::base_object<std::string>(str);
63 template <
typename Archiver>
69 template <
typename Archiver>
71 "Use void save(Archiver& ar, const std::string& str, const unsigned int vtkNotUsed(version))")
78 template <
typename Archiver>
86 template <
typename Archiver>
88 "Use void load(Archiver& ar, std::string& str, const unsigned int vtkNotUsed(version))")
102 template <
typename Archiver>
117 #define VTK_VARIANT_SAVE(Value, Type, Function) \
120 Type value = variant.Function(); \
142 cerr <<
"cannot serialize variant with type " << variant.
GetType() <<
'\n';
144 #undef VTK_VARIANT_SAVE
147 template <
typename Archiver>
153 #define VTK_VARIANT_LOAD(Value, Type) \
158 variant = vtkVariant(value); \
182 cerr <<
"cannot deserialize variant with type " <<
static_cast<unsigned int>(
Type) <<
'\n';
185 #undef VTK_VARIANT_LOAD
194 template <
typename Archiver>
201 if (array.
GetName() !=
nullptr)
214 template <
typename Archiver>
virtual char * GetName()
Set/get array's name.
#define VTK_UNSIGNED_LONG_LONG
#define VTK_VARIANT_LOAD(Value, Type)
vtkVariant & GetValue(vtkIdType id) const
Get the data at a particular index.
#define VTK_UNICODE_STRING
#define VTK_UNSIGNED_SHORT
bool IsValid() const
Get whether the variant value is valid.
void serialize(Archiver &ar, vtkStdString &str, const unsigned int vtkNotUsed(version))
unsigned int GetType() const
Get the type of the variant.
#define VTK_DEPRECATED_IN_9_1_0(reason)
#define VTK_VARIANT_SAVE(Value, Type, Function)
An array holding vtkVariants.
static vtkUnicodeString from_utf8(const char *)
Constructs a string from a null-terminated sequence of UTF-8 encoded characters.
void SetNumberOfTuples(vtkIdType number) override
Set the number of tuples (a component group) in the array.
vtkIdType GetNumberOfTuples() const
Get the number of complete tuples (a component group) in the array.
void load(Archiver &ar, std::string &str, const unsigned int vtkNotUsed(version))
void SetValue(vtkIdType id, vtkVariant value)
Set the data at a particular index.
String class that stores Unicode text.
void save(Archiver &ar, const std::string &str, const unsigned int vtkNotUsed(version))
A atomic type representing the union of many types.
#define VTK_UNSIGNED_CHAR
#define VTK_UNSIGNED_LONG
Wrapper around std::string to keep symbols short.
virtual void SetName(const char *)
Set/get array's name.