1#ifndef UTIL_SERIALIZE_H
2#define UTIL_SERIALIZE_H
28 template <
class Archive,
typename T>
29 inline void serialize(Archive& ar, T& data,
const unsigned int version)
30 { data.serialize(ar, version); }
41 template <
class Archive,
typename T,
size_t N>
42 inline void serialize(Archive& ar, T data[N],
const unsigned int version)
44 for (
size_t i = 0; i < N; ++i) {
45 serialize(ar, data[i], version);
58 template <
class Archive,
typename T>
59 inline void serializeEnum(Archive& ar, T& data,
const unsigned int version = 0)
62 if (Archive::is_saving()) {
63 i = (
unsigned int)data;
66 if (Archive::is_loading()) {
80 template <
class Archive,
typename T>
84 if (Archive::is_saving()) {
88 if (Archive::is_loading()) {
File containing preprocessor macros for error handling.
#define UTIL_THROW(msg)
Macro for throwing an Exception, reporting function, file and line number.
void serializeEnum(Archive &ar, T &data, const unsigned int version=0)
Serialize an enumeration value.
void serializeCheck(Archive &ar, T &data, const char *label="")
Save a value, or save and check correctness on loading.
Utility classes for scientific computation.