Signet Forge 0.1.0
C++20 Parquet library with AI-native extensions
DEMO
Loading...
Searching...
No Matches
signet::forge::BufferInfo Struct Reference

Simple C-contiguous buffer descriptor for Python interop. More...

#include <numpy_bridge.hpp>

Public Attributes

void * data
 Pointer to contiguous data (non-owning)
 
size_t itemsize
 Bytes per element (e.g. 4 for float32)
 
std::string format
 Python struct format character (e.g. "f", "d")
 
int64_t ndim
 Number of dimensions.
 
std::vector< int64_t > shape
 Shape in each dimension (ndim elements)
 
std::vector< int64_t > strides
 Stride in bytes for each dimension (ndim elements)
 

Detailed Description

Simple C-contiguous buffer descriptor for Python interop.

Compatible with Python's buffer protocol (PEP 3118) and pybind11's py::buffer_info. Can also be used to construct NumPy's __array_interface__ dict.

Format strings follow Python struct module conventions: "f" = float32, "d" = float64, "i" = int32, "l" = int64, "b" = int8, "B" = uint8, "h" = int16, "e" = float16, "?" = bool

Note
Strides are always in bytes (not elements), matching PEP 3118.
See also
to_buffer_info

Definition at line 662 of file numpy_bridge.hpp.

Member Data Documentation

◆ data

void* signet::forge::BufferInfo::data

Pointer to contiguous data (non-owning)

Definition at line 663 of file numpy_bridge.hpp.

◆ format

std::string signet::forge::BufferInfo::format

Python struct format character (e.g. "f", "d")

Definition at line 665 of file numpy_bridge.hpp.

◆ itemsize

size_t signet::forge::BufferInfo::itemsize

Bytes per element (e.g. 4 for float32)

Definition at line 664 of file numpy_bridge.hpp.

◆ ndim

int64_t signet::forge::BufferInfo::ndim

Number of dimensions.

Definition at line 666 of file numpy_bridge.hpp.

◆ shape

std::vector<int64_t> signet::forge::BufferInfo::shape

Shape in each dimension (ndim elements)

Definition at line 667 of file numpy_bridge.hpp.

◆ strides

std::vector<int64_t> signet::forge::BufferInfo::strides

Stride in bytes for each dimension (ndim elements)

Definition at line 668 of file numpy_bridge.hpp.


The documentation for this struct was generated from the following file: