MCPcopy Create free account
hub / github.com/pybind/pybind11 / get_buffer

Method get_buffer

tests/test_buffers.cpp:496–503  ·  view source on GitHub ↗

Exercises def_buffer(Return (Class::*)(Args...) &)

Source from the content-addressed store, hash-verified

494 ~OneDBufferLRef() { delete[] m_data; }
495 // Exercises def_buffer(Return (Class::*)(Args...) &)
496 py::buffer_info get_buffer() & {
497 return py::buffer_info(m_data,
498 sizeof(float),
499 py::format_descriptor<float>::format(),
500 1,
501 {m_n},
502 {(py::ssize_t) sizeof(float)});
503 }
504 };
505 py::class_<OneDBufferLRef>(m, "OneDBufferLRef", py::buffer_protocol())
506 .def(py::init<py::ssize_t>())

Callers

nothing calls this directly

Calls 1

buffer_infoClass · 0.85

Tested by

no test coverage detected