mirror of
https://github.com/varun-r-mallya/pylibbpf.git
synced 2025-12-31 20:36:26 +00:00
Make bytes_to_python const non-static
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
#include "core/bpf_map.h"
|
||||
#include "core/bpf_exception.h"
|
||||
#include "core/bpf_object.h"
|
||||
#include "utils/struct_parser.h"
|
||||
#include <algorithm>
|
||||
#include <cerrno>
|
||||
#include <cstring>
|
||||
@ -233,7 +234,7 @@ void BpfMap::python_to_bytes_inplace(const py::object &obj,
|
||||
}
|
||||
}
|
||||
|
||||
py::object BpfMap::bytes_to_python(std::span<const uint8_t> data) {
|
||||
py::object BpfMap::bytes_to_python(std::span<const uint8_t> data) const {
|
||||
// NOTE: Struct parsing for value type
|
||||
if (struct_parser_ && !value_struct_name_.empty()) {
|
||||
py::bytes py_data(reinterpret_cast<const char *>(data.data()), data.size());
|
||||
|
||||
@ -79,7 +79,7 @@ public:
|
||||
private:
|
||||
static void python_to_bytes_inplace(const py::object &obj,
|
||||
std::span<uint8_t> buffer);
|
||||
static py::object bytes_to_python(std::span<const uint8_t> data);
|
||||
py::object bytes_to_python(std::span<const uint8_t> data) const;
|
||||
};
|
||||
|
||||
#endif // PYLIBBPF_BPF_MAP_H
|
||||
|
||||
Reference in New Issue
Block a user