CNORXZ
Container with Native Operation Routines and Expressions
Loading...
Searching...
No Matches
cer_header.cc.h
Go to the documentation of this file.
1// -*- C++ -*-
12#ifndef __cxz_cereal_header_cc_h__
13#define __cxz_cereal_header_cc_h__
14
15#include "cer_header.h"
16
17namespace CNORXZ
18{
19 namespace cer
20 {
21 template <class Archive>
22 void save(Archive& ar, const Header& h, const std::uint32_t version)
23 {
24 CXZ_ASSERT(version == 1u, "format version = " << version << " not supported");
25 ar(cereal::make_nvp("version",h.version));
26 ar(cereal::make_nvp("commit",h.commit));
27 ar(cereal::make_nvp("content",static_cast<SizeT>(h.content)));
28 }
29
30 template <class Archive>
31 void load(Archive& ar, Header& h, const std::uint32_t version)
32 {
33 CXZ_ASSERT(version == 1u, "format version = " << version << " not supported");
34 ar(cereal::make_nvp("version",h.version));
35 ar(cereal::make_nvp("commit",h.commit));
36 SizeT hc;
37 ar(cereal::make_nvp("content",hc));
38 h.content = static_cast<ContentType>(hc);
39 }
40
41 }
42}
43
44#endif
#define CXZ_ASSERT(statement, errmsg)
Definition assert.h:40
CNORXZ Cereal data header declaration.
void load(Archive &ar, Header &h, const std::uint32_t version)
void save(Archive &ar, const Header &h, const std::uint32_t version)
uint64_t SizeT
Definition types.h:38
Sptr< Range > rangeCast(const RangePtr r)