CNORXZ
Container with Native Operation Routines and Expressions
Loading...
Searching...
No Matches
utilities.h
Go to the documentation of this file.
1// -*- C++ -*-
12#ifndef __cxz_cereal_utilities_h__
13#define __cxz_cereal_utilities_h__
14
15#include <istream>
16#include <ostream>
17#include "base/base.h"
18#include "cer_base.h"
19#include <cereal/archives/xml.hpp>
20#include <cereal/archives/json.hpp>
21#include <cereal/archives/binary.hpp>
22
23namespace CNORXZ
24{
25 namespace cer
26 {
31 template <Format F>
33 {};
34
36 template <>
38 { typedef cereal::BinaryOutputArchive type; };
39
41 template <>
43 { typedef cereal::JSONOutputArchive type; };
44
46 template <>
48 { typedef cereal::XMLOutputArchive type; };
49
54 template <Format F>
56 {};
57
59 template <>
61 { typedef cereal::BinaryInputArchive type; };
62
64 template <>
66 { typedef cereal::JSONInputArchive type; };
67
69 template <>
71 { typedef cereal::XMLInputArchive type; };
72
79 template <Format F, typename T>
80 void write(std::ostream& os, const MArray<T>& data);
81
88 template <Format F, typename T>
89 void read(std::istream& is, MArray<T>& data);
90
97 template <Format F, typename T>
98 void writeFile(const String& name, const MArray<T>& data);
99
106 template <Format F, typename T>
107 void readFile(const String& name, MArray<T>& data);
108
114 template <typename T>
115 inline void writeBINARYFile(const String& name, const MArray<T>& data)
116 { writeFile<Format::BINARY>(name, data); }
117
123 template <typename T>
124 inline void readBINARYFile(const String& name, MArray<T>& data)
125 { readFile<Format::BINARY>(name, data); }
126
132 template <typename T>
133 inline void writeJSONFile(const String& name, const MArray<T>& data)
134 { writeFile<Format::JSON>(name, data); }
135
141 template <typename T>
142 inline void readJSONFile(const String& name, MArray<T>& data)
143 { readFile<Format::JSON>(name, data); }
144
150 template <typename T>
151 inline void writeXMLFile(const String& name, const MArray<T>& data)
152 { writeFile<Format::XML>(name, data); }
153
159 template <typename T>
160 inline void readXMLFile(const String& name, MArray<T>& data)
161 { readFile<Format::XML>(name, data); }
162 }
163}
164
165#endif
basic headers
CNORXZ Cereal basic types declaration.
void readXMLFile(const String &name, MArray< T > &data)
Definition utilities.h:160
void writeJSONFile(const String &name, const MArray< T > &data)
Definition utilities.h:133
void writeXMLFile(const String &name, const MArray< T > &data)
Definition utilities.h:151
void read(std::istream &is, MArray< T > &data)
void writeFile(const String &name, const MArray< T > &data)
void writeBINARYFile(const String &name, const MArray< T > &data)
Definition utilities.h:115
void readFile(const String &name, MArray< T > &data)
void readBINARYFile(const String &name, MArray< T > &data)
Definition utilities.h:124
void write(std::ostream &os, const MArray< T > &data)
void readJSONFile(const String &name, MArray< T > &data)
Definition utilities.h:142
std::string String
Definition types.h:42
Sptr< Range > rangeCast(const RangePtr r)