1 #ifndef FWCore_PyDevParameterSet_PyBind11Module_h
2 #define FWCore_PyDevParameterSet_PyBind11Module_h
15 #include <pybind11/stl.h>
33 #include <pybind11/pybind11.h>
38 pybind11::register_exception_translator([](std::exception_ptr
p) {
41 std::rethrow_exception(
p);
43 PyErr_SetString(PyExc_RuntimeError,
e.what());
47 pybind11::class_<edm::InputTag>(
m,
"InputTag")
48 .def(pybind11::init<>())
49 .def(pybind11::init<const std::string &>())
50 .def(pybind11::init<const std::string &, const std::string &, const std::string &>())
51 .def(pybind11::init<const std::string &, const std::string &>())
56 pybind11::class_<edm::ESInputTag>(
m,
"ESInputTag")
57 .def(pybind11::init<std::string>())
58 .def(pybind11::init<std::string, std::string>())
62 pybind11::class_<edm::EventID>(
m,
"EventID")
63 .def(pybind11::init<edm::RunNumber_t, edm::LuminosityBlockNumber_t, edm::EventNumber_t>())
68 pybind11::class_<edm::LuminosityBlockID>(
m,
"LuminosityBlockID")
69 .def(pybind11::init<unsigned int, unsigned int>())
73 pybind11::class_<edm::FileInPath>(
m,
"FileInPath")
74 .def(pybind11::init<std::string>())
78 pybind11::class_<edm::LuminosityBlockRange>(
m,
"LuminosityBlockRange")
79 .def(pybind11::init<unsigned int, unsigned int, unsigned int, unsigned int>())
85 pybind11::class_<edm::EventRange>(
m,
"EventRange")
99 pybind11::class_<Python11ParameterSet>(
m,
"ParameterSet")
100 .def(pybind11::init<>())
101 .def(
"addInt32", &Python11ParameterSet::addParameter<int>)
102 .def(
"getInt32", &Python11ParameterSet::getParameter<int>)
103 .def(
"addVInt32", &Python11ParameterSet::addParameters<int>)
104 .def(
"getVInt32", &Python11ParameterSet::getParameters<int>)
105 .def(
"addUInt32", &Python11ParameterSet::addParameter<unsigned int>)
106 .def(
"getUInt32", &Python11ParameterSet::getParameter<unsigned int>)
107 .def(
"addVUInt32", &Python11ParameterSet::addParameters<unsigned int>)
108 .def(
"getVUInt32", &Python11ParameterSet::getParameters<unsigned int>)
109 .def(
"addInt64", &Python11ParameterSet::addParameter<long long>)
110 .def(
"getInt64", &Python11ParameterSet::getParameter<long long>)
111 .def(
"addUInt64", &Python11ParameterSet::addParameter<unsigned long long>)
112 .def(
"getUInt64", &Python11ParameterSet::getParameter<unsigned long long>)
113 .def(
"addVInt64", &Python11ParameterSet::addParameters<long long>)
114 .def(
"getVInt64", &Python11ParameterSet::getParameters<long long>)
115 .def(
"addVUInt64", &Python11ParameterSet::addParameters<unsigned long long>)
116 .def(
"getVUInt64", &Python11ParameterSet::getParameters<unsigned long long>)
117 .def(
"addDouble", &Python11ParameterSet::addParameter<double>)
118 .def(
"getDouble", &Python11ParameterSet::getParameter<double>)
119 .def(
"addVDouble", &Python11ParameterSet::addParameters<double>)
120 .def(
"getVDouble", &Python11ParameterSet::getParameters<double>)
121 .def(
"addBool", &Python11ParameterSet::addParameter<bool>)
122 .def(
"getBool", &Python11ParameterSet::getParameter<bool>)
123 .def(
"addString", &Python11ParameterSet::addParameter<std::string>)
124 .def(
"getString", &Python11ParameterSet::getParameter<std::string>)
125 .def(
"addVString", &Python11ParameterSet::addParameters<std::string>)
126 .def(
"getVString", &Python11ParameterSet::getParameters<std::string>)
127 .def(
"addInputTag", &Python11ParameterSet::addParameter<edm::InputTag>)
128 .def(
"getInputTag", &Python11ParameterSet::getParameter<edm::InputTag>)
129 .def(
"addVInputTag", &Python11ParameterSet::addParameters<edm::InputTag>)
130 .def(
"getVInputTag", &Python11ParameterSet::getParameters<edm::InputTag>)
131 .def(
"addESInputTag", &Python11ParameterSet::addParameter<edm::ESInputTag>)
132 .def(
"getESInputTag", &Python11ParameterSet::getParameter<edm::ESInputTag>)
133 .def(
"addVESInputTag", &Python11ParameterSet::addParameters<edm::ESInputTag>)
134 .def(
"getVESInputTag", &Python11ParameterSet::getParameters<edm::ESInputTag>)
135 .def(
"addEventID", &Python11ParameterSet::addParameter<edm::EventID>)
136 .def(
"getEventID", &Python11ParameterSet::getParameter<edm::EventID>)
137 .def(
"addVEventID", &Python11ParameterSet::addParameters<edm::EventID>)
138 .def(
"getVEventID", &Python11ParameterSet::getParameters<edm::EventID>)
139 .def(
"addLuminosityBlockID", &Python11ParameterSet::addParameter<edm::LuminosityBlockID>)
140 .def(
"getLuminosityBlockID", &Python11ParameterSet::getParameter<edm::LuminosityBlockID>)
141 .def(
"addVLuminosityBlockID", &Python11ParameterSet::addParameters<edm::LuminosityBlockID>)
142 .def(
"getVLuminosityBlockID", &Python11ParameterSet::getParameters<edm::LuminosityBlockID>)
143 .def(
"addLuminosityBlockRange", &Python11ParameterSet::addParameter<edm::LuminosityBlockRange>)
144 .def(
"getLuminosityBlockRange", &Python11ParameterSet::getParameter<edm::LuminosityBlockRange>)
145 .def(
"addVLuminosityBlockRange", &Python11ParameterSet::addParameters<edm::LuminosityBlockRange>)
146 .def(
"getVLuminosityBlockRange", &Python11ParameterSet::getParameters<edm::LuminosityBlockRange>)
147 .def(
"addEventRange", &Python11ParameterSet::addParameter<edm::EventRange>)
148 .def(
"getEventRange", &Python11ParameterSet::getParameter<edm::EventRange>)
149 .def(
"addVEventRange", &Python11ParameterSet::addParameters<edm::EventRange>)
150 .def(
"getVEventRange", &Python11ParameterSet::getParameters<edm::EventRange>)
155 .def(
"addFileInPath", &Python11ParameterSet::addParameter<edm::FileInPath>)
156 .def(
"getFileInPath", &Python11ParameterSet::getParameter<edm::FileInPath>)
167 pybind11::class_<PyBind11ProcessDesc>(
m,
"ProcessDesc")
168 .def(pybind11::init<>())
169 .def(pybind11::init<std::string>())