RTC Toolkit 5.0.0
Loading...
Searching...
No Matches
Namespaces | Macros | Functions
vectorPy.cpp File Reference

Implementation of the embedded Python module for vector classes. More...

#include "rtctk/componentFramework/vectorPy.hpp"
#include <pybind11/embed.h>
#include <pybind11/numpy.h>
#include <pybind11/pybind11.h>
#include <pybind11/stl_bind.h>
#include <vector>

Namespaces

namespace  rtctk
 
namespace  rtctk::componentFramework
 

Macros

#define VB(TYPE, NAME)
 

Functions

 rtctk::componentFramework::PYBIND11_EMBEDDED_MODULE (Import_Vector_Buffer, mod)
 
py::module RTCTK_API rtctk::componentFramework::LoadVectorBufferPyBinds ()
 Imports the embedded Python module to access supported C++ std::vector objects.
 

Detailed Description

Implementation of the embedded Python module for vector classes.

Macro Definition Documentation

◆ VB

#define VB ( TYPE,
NAME )
Value:
py::class_<std::vector<TYPE>>(mod, NAME, py::buffer_protocol()) \
.def_buffer([](std::vector<TYPE>& vec) -> py::buffer_info { \
return py::buffer_info(vec.data(), \
sizeof(TYPE), \
py::format_descriptor<TYPE>::format(), \
1, \
{vec.size()}, \
{sizeof(TYPE)}); \
});