Skip to content

Commit

Permalink
[cmake] Adjust h5 serialization code for use with standalone h5 repos…
Browse files Browse the repository at this point in the history
…itory
  • Loading branch information
Wentzell committed May 22, 2020
1 parent 5efea92 commit 00acaa0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cpp2py/mako/wrap.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ using ${ns};
%endif
%endfor
%if include_serialization==1 :
#include <triqs/h5/serialization.hpp>
#include <h5/serialization.hpp>
%endif

using namespace cpp2py;
Expand Down Expand Up @@ -721,15 +721,15 @@ static PyObject* ${c.py_type}___reduce__ (PyObject *self, PyObject *args, PyObje
"Cannot find the reconstruction function ${module.full_name}.__reduce_reconstructor__${c.py_type}");
return NULL;
}
return Py_BuildValue("(NN)", r.new_ref() , Py_BuildValue("(N)", convert_to_python(triqs::h5::serialize(self_c))));
return Py_BuildValue("(NN)", r.new_ref() , Py_BuildValue("(N)", convert_to_python(h5::serialize(self_c))));
}

//
static PyObject* ${c.py_type}___reduce_reconstructor__ (PyObject *self, PyObject *args, PyObject *keywds) {
PyObject* a1 = PyTuple_GetItem(args,0); //
auto a = convert_from_python<triqs::arrays::array_const_view<triqs::h5::h5_serialization_char_t,1>>(a1);
auto a = convert_from_python<std::vector<unsigned char>>(a1);
try {
return convert_to_python( triqs::h5::deserialize<${c.c_type}>(a));
return convert_to_python( h5::deserialize<${c.c_type}>(a));
}
CATCH_AND_RETURN("in unserialization of object ${c.py_type}",NULL);
}
Expand Down

0 comments on commit 00acaa0

Please sign in to comment.