mirror of
https://github.com/varun-r-mallya/pylibbpf.git
synced 2026-02-12 16:11:00 +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_map.h"
|
||||||
#include "core/bpf_exception.h"
|
#include "core/bpf_exception.h"
|
||||||
#include "core/bpf_object.h"
|
#include "core/bpf_object.h"
|
||||||
|
#include "utils/struct_parser.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cerrno>
|
#include <cerrno>
|
||||||
#include <cstring>
|
#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
|
// NOTE: Struct parsing for value type
|
||||||
if (struct_parser_ && !value_struct_name_.empty()) {
|
if (struct_parser_ && !value_struct_name_.empty()) {
|
||||||
py::bytes py_data(reinterpret_cast<const char *>(data.data()), data.size());
|
py::bytes py_data(reinterpret_cast<const char *>(data.data()), data.size());
|
||||||
|
|||||||
@ -79,7 +79,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
static void python_to_bytes_inplace(const py::object &obj,
|
static void python_to_bytes_inplace(const py::object &obj,
|
||||||
std::span<uint8_t> buffer);
|
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
|
#endif // PYLIBBPF_BPF_MAP_H
|
||||||
|
|||||||
Reference in New Issue
Block a user