Use shared_from_this while creating BpfProgram or BpfMap, make get_map_names and get_program_names non-const

This commit is contained in:
Pragyansh Chaturvedi
2025-10-19 03:04:11 +05:30
parent 1c2e170bab
commit c0b982a514
2 changed files with 10 additions and 10 deletions

View File

@ -65,7 +65,7 @@ public:
py::dict attach_all();
// Program access
[[nodiscard]] py::list get_program_names() const;
[[nodiscard]] py::list get_program_names();
[[nodiscard]] std::shared_ptr<BpfProgram>
get_program(const std::string &name);
[[nodiscard]] struct bpf_program *
@ -73,7 +73,7 @@ public:
[[nodiscard]] py::dict get_cached_programs() const;
// Map access
[[nodiscard]] py::list get_map_names() const;
[[nodiscard]] py::list get_map_names();
[[nodiscard]] std::shared_ptr<BpfMap> get_map(const std::string &name);
[[nodiscard]] struct bpf_map *find_map_by_name(const std::string &name) const;
[[nodiscard]] py::dict get_cached_maps() const;