We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b4d0a49 commit f787413Copy full SHA for f787413
src/core/bpf_map.h
@@ -15,7 +15,7 @@ class BpfObject;
15
16
namespace py = pybind11;
17
18
-class BpfMap {
+class BpfMap : public std::enable_shared_from_this<BpfMap> {
19
private:
20
std::weak_ptr<BpfObject> parent_obj_;
21
struct bpf_map *map_;
@@ -62,6 +62,9 @@ class BpfMap {
62
[[nodiscard]] int get_key_size() const { return key_size_; };
63
[[nodiscard]] int get_value_size() const { return value_size_; };
64
[[nodiscard]] int get_max_entries() const;
65
+ [[nodiscard]] std::shared_ptr<BpfObject> get_parent() const {
66
+ return parent_obj_.lock();
67
+ }
68
69
70
static void python_to_bytes_inplace(const py::object &obj,
0 commit comments