HepMC3 event record library
Public Types | Public Member Functions | Static Public Member Functions | Data Fields | Static Public Attributes | Protected Types | Static Protected Member Functions | Private Types
type_caster_base< type > Class Template Reference

Generic type caster for objects stored on the heap. More...

#include <cast.h>

+ Inheritance diagram for type_caster_base< type >:
+ Collaboration diagram for type_caster_base< type >:

Public Types

template<typename T >
using cast_op_type = detail::cast_op_type< T >
 

Public Member Functions

 type_caster_base (const std::type_info &info)
 
 operator itype * ()
 
 operator itype & ()
 
bool load (handle src, bool convert)
 
void load_value (value_and_holder &&v_h)
 
bool try_implicit_casts (handle src, bool convert)
 
bool try_direct_conversions (handle src)
 
void check_holder_compat ()
 
PYBIND11_NOINLINE bool try_load_foreign_module_local (handle src)
 
template<typename ThisT >
PYBIND11_NOINLINE bool load_impl (handle src, bool convert)
 

Static Public Member Functions

static handle cast (const itype &src, return_value_policy policy, handle parent)
 
static handle cast (itype &&src, return_value_policy, handle parent)
 
static std::pair< const void
*, const type_info * > 
src_and_type (const itype *src)
 
static handle cast (const itype *src, return_value_policy policy, handle parent)
 
static handle cast_holder (const itype *src, const void *holder)
 
static PYBIND11_NOINLINE handle cast (const void *_src, return_value_policy policy, handle parent, const detail::type_info *tinfo, void *(*copy_constructor)(const void *), void *(*move_constructor)(const void *), const void *existing_holder=nullptr)
 
static PYBIND11_NOINLINE void * local_load (PyObject *src, const type_info *ti)
 
static PYBIND11_NOINLINE
std::pair< const void *, const
type_info * > 
src_and_type (const void *src, const std::type_info &cast_type, const std::type_info *rtti_type=nullptr)
 

Data Fields

const type_infotypeinfo = nullptr
 
const std::type_info * cpptype = nullptr
 
void * value = nullptr
 

Static Public Attributes

static constexpr auto name = _<type>()
 

Protected Types

using Constructor = void *(*)(const void *)
 

Static Protected Member Functions

template<typename T , typename = enable_if_t<is_copy_constructible<T>::value>>
static auto make_copy_constructor (const T *x) -> decltype(new T(*x), Constructor
 
template<typename T , typename = enable_if_t<std::is_move_constructible<T>::value>>
static auto make_move_constructor (const T *x) -> decltype(new T(std::move(*const_cast< T * >(x))), Constructor
 
static Constructor make_copy_constructor (...)
 
static Constructor make_move_constructor (...)
 

Private Types

using itype = intrinsic_t< type >
 

Detailed Description

template<typename type>
class type_caster_base< type >

Generic type caster for objects stored on the heap.

Definition at line 861 of file cast.h.

Member Function Documentation

PYBIND11_NOINLINE bool try_load_foreign_module_local ( handle  src)
inlineinherited

Try to load with foreign typeinfo, if available. Used when there is no native typeinfo, or when the native one wasn't able to produce a value.

Definition at line 637 of file cast.h.

References type::handle_of(), and handle::ptr().


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