1 #ifndef CondCore_Utilities_Payload2XMLModule_h
2 #define CondCore_Utilities_Payload2XMLModule_h
7 #include <pybind11/pybind11.h>
9 namespace py = pybind11;
13 #define XML_CONVERTER_NAME(CLASS_NAME) (std::string(#CLASS_NAME) + "2xml").c_str()
15 #define PAYLOAD_2XML_MODULE(MODULE_NAME) PYBIND11_MODULE(MODULE_NAME, m)
17 #define PAYLOAD_2XML_CLASS(CLASS_NAME) \
18 py::class_<Payload2xml<CLASS_NAME> >(m, XML_CONVERTER_NAME(CLASS_NAME)) \
20 .def("write", &Payload2xml<CLASS_NAME>::write);
22 #include <boost/version.hpp>
26 ss << BOOST_VERSION / 100000 <<
".";
27 ss << BOOST_VERSION / 100 % 1000 <<
".";
28 ss << BOOST_VERSION % 100;
35 template <
typename PayloadType>
42 std::unique_ptr<PayloadType>
payload;
43 std::stringbuf sdataBuf;
44 sdataBuf.pubsetbuf(const_cast<char *>(payloadData.c_str()), payloadData.size());
46 std::istream inBuffer(&sdataBuf);
48 payload.reset(
new PayloadType);
52 std::ostringstream outBuffer;
54 boost::archive::xml_oarchive xmlResult(outBuffer);
55 xmlResult << boost::serialization::make_nvp(
"cmsCondPayload", *payload);
57 return outBuffer.str();
eos::portable_iarchive InputArchive
std::string boost_version_label()