diff --git a/include/SciHook.h b/include/SciHook.h index ba72323..8b499cd 100644 --- a/include/SciHook.h +++ b/include/SciHook.h @@ -18,32 +18,6 @@ namespace py = pybind11; namespace SciHook { - struct __attribute__((visibility("default"))) DataFlowDict { - const std::map>& map; - - std::vector get(py::object key) const { - auto it = map.find(py::hash(key)); - if (it == map.end()) { - throw py::key_error(); - } - return it->second; - } - - bool empty() const { return !map.empty(); }; - - py::iterator iter() const { return py::make_key_iterator(map.begin(), map.end()); }; - - bool contains(py::object key) const { - auto it = map.find(py::hash(key)); - if (it == map.end()) { - return false; - } - return true; - }; - - DataFlowDict(const std::map>& map) : map(map) {} - }; - struct SciHookExecutionContext { std::string name = "SciHookExecutionContext"; diff --git a/src/bindings/scihook_module.cc b/src/bindings/scihook_module.cc index 449890f..1c22268 100644 --- a/src/bindings/scihook_module.cc +++ b/src/bindings/scihook_module.cc @@ -21,17 +21,4 @@ PYBIND11_MODULE(_scihook, m) { { SciHook::trigger(event_id, scope); }); - - py::class_(m, "DataFlowDict") - .def("__bool__", [](const SciHook::DataFlowDict &self) -> bool { return !self.empty(); }) - .def("__iter__", [](const SciHook::DataFlowDict &self) { return self.iter(); }, py::keep_alive<0, 1>()) - .def("__getitem__", [](const SciHook::DataFlowDict &self, const py::object &key) -> std::vector { - return self.get(key); - }, - py::return_value_policy::reference_internal - ) - .def("__contains__", [](const SciHook::DataFlowDict &self, const py::object &key) -> bool { - return self.contains(key); - }); - } \ No newline at end of file