Drake
wrap_pybind.h File Reference

Defines convenience utilities to wrap pybind11 methods and classes. More...

#include <string>
#include <utility>
#include "pybind11/pybind11.h"
#include "drake/bindings/pydrake/util/wrap_function.h"
#include "drake/common/drake_copyable.h"
Include dependency graph for wrap_pybind.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  MirrorDef< A, B >
 Defines a function in object a and mirrors def calls to object b. More...
 
struct  wrap_ref_ptr< T, typename >
 
struct  wrap_ref_ptr< T &, std::enable_if_t< is_generic_pybind< T >::value > >
 
struct  wrap_callback< T, typename >
 
struct  wrap_callback< const std::function< Signature > & >
 
struct  wrap_callback< std::function< Signature > >
 

Namespaces

 drake
 
 drake::pydrake
 
 drake::pydrake::detail
 

Typedefs

template<typename T >
using is_generic_pybind = std::is_base_of< py::detail::type_caster_generic, py::detail::make_caster< T >>
 

Functions

template<typename Func >
auto WrapCallbacks (Func &&func)
 Ensures that any std::function<> arguments are wrapped such that any T& (which can infer for T = const U) is wrapped as U* (and conversely unwrapped when returned). More...
 
template<typename PyClass , typename Class , typename T >
void DefReadWriteKeepAlive (PyClass *cls, const char *name, T Class::*member)
 Idempotent to pybind11's def_readwrite(), with the exception that the setter is protected with keep_alive on a member variable that is a bare pointer. More...
 

Detailed Description

Defines convenience utilities to wrap pybind11 methods and classes.