#include <pybind11/pytypes.h>
#include "common.h"
#include "cpp_conduit.h"
#include "descr.h"
#include "internals.h"
#include "typeid.h"
#include "value_and_holder.h"
#include <cstdint>
#include <cstring>
#include <iterator>
#include <new>
#include <stdexcept>
#include <string>
#include <type_traits>
#include <typeindex>
#include <typeinfo>
#include <unordered_map>
#include <utility>
#include <vector>
Go to the source code of this file.
|
struct | container_mapped_type_traits< Container, SFINAE > |
|
struct | container_mapped_type_traits< Container, typename std::enable_if< negation< std::is_same< typename Container::mapped_type, Container > >::value >::type > |
|
struct | container_mapped_type_traits< Container, typename std::enable_if< std::is_same< typename Container::mapped_type, Container >::value >::type > |
|
struct | container_value_type_traits< Container, SFINAE > |
|
struct | container_value_type_traits< Container, typename std::enable_if< negation< std::is_same< typename Container::value_type, Container > >::value >::type > |
|
struct | container_value_type_traits< Container, typename std::enable_if< std::is_same< typename Container::value_type, Container >::value >::type > |
|
struct | impl_recursive_container_traits< Container, SFINAE > |
|
struct | impl_recursive_container_traits< Container, typename std::enable_if< container_value_type_traits< Container >::has_value_type >::type > |
|
struct | impl_type_to_check_recursively< T, is_this_a_map > |
|
struct | impl_type_to_check_recursively< std::pair< A, B >, true > |
|
struct | is_copy_assignable< T > |
|
struct | is_copy_assignable< recursive_bottom > |
|
struct | is_copy_assignable< std::pair< T1, T2 > > |
|
struct | is_copy_constructible< T > |
|
struct | is_copy_constructible< recursive_bottom > |
|
struct | is_copy_constructible< std::pair< T1, T2 > > |
|
struct | is_move_constructible< T > |
|
struct | is_move_constructible< recursive_bottom > |
|
struct | is_move_constructible< std::pair< T1, T2 > > |
|
struct | values_and_holders::iterator |
|
class | loader_life_support |
|
struct | polymorphic_type_hook< itype, SFINAE > |
|
struct | polymorphic_type_hook_base< itype, SFINAE > |
|
struct | polymorphic_type_hook_base< itype, detail::enable_if_t< std::is_polymorphic< itype >::value > > |
|
struct | recursive_bottom |
|
struct | recursive_container_traits< Container, SFINAE > |
|
class | type_caster_base< type > |
| Generic type caster for objects stored on the heap. More...
|
|
class | type_caster_generic |
|
struct | values_and_holders |
|
|
const std::vector< detail::type_info * > & | all_type_info (PyTypeObject *type) |
|
void | all_type_info_add_base_most_derived_first (std::vector< type_info * > &bases, type_info *addl_base) |
|
std::pair< decltype(internals::registered_types_py)::iterator, bool > | all_type_info_get_cache (PyTypeObject *type) |
|
PYBIND11_NOINLINE void | all_type_info_populate (PyTypeObject *t, std::vector< type_info * > &bases) |
|
object | cpp_conduit_method (handle self, const bytes &pybind11_platform_abi_id, const capsule &cpp_type_info_capsule, const bytes &pointer_kind) |
|
PYBIND11_NOINLINE handle | find_registered_python_instance (void *src, const detail::type_info *tinfo) |
|
detail::type_info * | get_global_type_info (const std::type_index &tp) |
|
detail::type_info * | get_local_type_info (const std::type_index &tp) |
|
PYBIND11_NOINLINE handle | get_object_handle (const void *ptr, const detail::type_info *type) |
|
PyThreadState * | get_thread_state_unchecked () |
|
PYBIND11_NOINLINE handle | get_type_handle (const std::type_info &tp, bool throw_if_missing) |
|
PYBIND11_NOINLINE detail::type_info * | get_type_info (const std::type_index &tp, bool throw_if_missing=false) |
|
PYBIND11_NOINLINE detail::type_info * | get_type_info (PyTypeObject *type) |
|
PYBIND11_NOINLINE bool | isinstance_generic (handle obj, const std::type_info &tp) |
|
void | keep_alive_impl (handle nurse, handle patient) |
|
PyObject * | make_new_instance (PyTypeObject *type) |
|
std::string | quote_cpp_type_name (const std::string &cpp_type_name) |
|
PYBIND11_NOINLINE std::string | type_info_description (const std::type_info &ti) |
|
◆ cast_op_type
Determine suitable casting operator for pointer-or-lvalue-casting type casters. The type caster needs to provide operator T*()
and operator T&()
operators.
If the type supports moving the value away via an operator T&&() &&
method, it should use movable_cast_op_type
instead.
Definition at line 822 of file type_caster_base.h.
◆ movable_cast_op_type
Determine suitable casting operator for a type caster with a movable value. Such a type caster needs to provide operator T*()
, operator T&()
, and operator T&&() &&
. The latter will be called in appropriate contexts where the value can be moved rather than copied.
These operator are automatically provided when using the PYBIND11_TYPE_CASTER macro.
Definition at line 837 of file type_caster_base.h.
◆ all_type_info()
const std::vector<detail::type_info *>& all_type_info |
( |
PyTypeObject * |
type | ) |
|
|
inline |
Extracts vector of type_info pointers of pybind-registered roots of the given Python type. Will be just 1 pybind type for the Python type of a pybind-registered class, or for any Python-side derived class that uses single inheritance. Will contain as many types as required for a Python class that uses multiple inheritance to inherit (directly or indirectly) from multiple pybind-registered classes. Will be empty if neither the type nor any base classes are pybind-registered.
The value is cached for the lifetime of the Python type.
Definition at line 178 of file type_caster_base.h.
◆ all_type_info_add_base_most_derived_first()
void all_type_info_add_base_most_derived_first |
( |
std::vector< type_info * > & |
bases, |
|
|
type_info * |
addl_base |
|
) |
| |
|
inline |
◆ all_type_info_get_cache()
◆ all_type_info_populate()
◆ cpp_conduit_method()
object cpp_conduit_method |
( |
handle |
self, |
|
|
const bytes & |
pybind11_platform_abi_id, |
|
|
const capsule & |
cpp_type_info_capsule, |
|
|
const bytes & |
pointer_kind |
|
) |
| |
|
inline |
◆ find_registered_python_instance()
◆ get_global_type_info()
detail::type_info* get_global_type_info |
( |
const std::type_index & |
tp | ) |
|
|
inline |
◆ get_local_type_info()
detail::type_info* get_local_type_info |
( |
const std::type_index & |
tp | ) |
|
|
inline |
◆ get_object_handle()
◆ get_thread_state_unchecked()
PyThreadState* get_thread_state_unchecked |
( |
| ) |
|
|
inline |
◆ get_type_handle()
◆ get_type_info() [1/2]
PYBIND11_NOINLINE detail::type_info* get_type_info |
( |
const std::type_index & |
tp, |
|
|
bool |
throw_if_missing = false |
|
) |
| |
Return the type info for a given C++ type; on lookup failure can either throw or return nullptr.
Definition at line 228 of file type_caster_base.h.
◆ get_type_info() [2/2]
Gets a single pybind11 type info for a python type. Returns nullptr if neither the type nor any ancestors are pybind11-registered. Throws an exception if there are multiple bases–use all_type_info
instead if you want to support multiple bases.
Definition at line 193 of file type_caster_base.h.
◆ isinstance_generic()
◆ keep_alive_impl()
◆ make_new_instance()
PyObject* make_new_instance |
( |
PyTypeObject * |
type | ) |
|
|
inline |
Instance creation function for all pybind11 types. It allocates the internal instance layout for holding C++ objects and holders. Allocation is done lazily (the first time the instance is cast to a reference or pointer), and initialization is done by an __init__
function.
Definition at line 350 of file class.h.
◆ quote_cpp_type_name()
std::string quote_cpp_type_name |
( |
const std::string & |
cpp_type_name | ) |
|
|
inline |
◆ type_info_description()