Scarab  v2.9.1
Project 8 C++ Utility Library
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Friends | List of all members
copyable_holder_caster< type, holder_type > Struct Template Reference

Type caster for holder types like std::shared_ptr, etc. More...

#include <cast.h>

Inheritance diagram for copyable_holder_caster< type, holder_type >:
Inheritance graph

Public Types

using base = type_caster_base< type >
 
- Public Types inherited from type_caster_base< type >
template<typename T >
using cast_op_type = detail::cast_op_type< T >
 

Public Member Functions

bool load (handle src, bool convert)
 
 operator type * ()
 
 operator type & ()
 
 operator holder_type * ()
 
 operator holder_type & ()
 
- Public Member Functions inherited from type_caster_base< type >
 type_caster_base ()
 
 type_caster_base (const std::type_info &info)
 
 operator itype * ()
 
 operator itype & ()
 
- Public Member Functions inherited from type_caster_generic
 __attribute__ ((noinline)) type_caster_generic(const std
 
 type_caster_generic (const type_info *typeinfo)
 
bool load (handle src, bool convert)
 
 __attribute__ ((noinline)) static handle cast(const void *_src
 

Static Public Member Functions

static handle cast (const holder_type &src, return_value_policy, handle)
 
- Static Public Member Functions inherited from type_caster_base< type >
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)
 

Protected Member Functions

void check_holder_compat ()
 
bool load_value (value_and_holder &&v_h)
 
template<typename T = holder_type, detail::enable_if_t<!std::is_constructible< T, const T &, type *>::value, int > = 0>
bool try_implicit_casts (handle, bool)
 
template<typename T = holder_type, detail::enable_if_t< std::is_constructible< T, const T &, type *>::value, int > = 0>
bool try_implicit_casts (handle src, bool convert)
 

Static Protected Member Functions

static bool try_direct_conversions (handle)
 
- Static Protected Member Functions inherited from type_caster_base< type >
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 (...)
 

Protected Attributes

holder_type holder
 

Friends

class type_caster_generic
 

Additional Inherited Members

- Public Attributes inherited from type_caster_generic
return_value_policy policy
 
return_value_policy handle parent
 
return_value_policy handle const detail::type_infotinfo
 
return_value_policy handle const detail::type_info void *(* copy_constructor )(const void *)
 
return_value_policy handle const detail::type_info void *(*) void *(* move_constructor )(const void *)
 
return_value_policy handle const detail::type_info void *(*) void *(*) const void existing_holder )
 
return_value_policy handle const detail::type_info void *(*) void *(*) const void const type_info src_and_type )(const void *src, const std::type_info &cast_type, const std::type_info *rtti_type=nullptr)
 
const type_infotypeinfo = nullptr
 
const std::type_info * cpptype = nullptr
 
void * value = nullptr
 
- Static Public Attributes inherited from type_caster_base< type >
static constexpr auto name = _<type>()
 
- Protected Types inherited from type_caster_base< type >
using Constructor = void *(*)(const void *)
 

Detailed Description

template<typename type, typename holder_type>
struct pybind11::detail::copyable_holder_caster< type, holder_type >

Type caster for holder types like std::shared_ptr, etc.

Definition at line 1436 of file cast.h.

Member Typedef Documentation

◆ base

Definition at line 1438 of file cast.h.

Member Function Documentation

◆ cast()

static handle cast ( const holder_type &  src,
return_value_policy  ,
handle   
)
inlinestatic

Definition at line 1462 of file cast.h.

◆ check_holder_compat()

void check_holder_compat ( )
inlineprotected

Definition at line 1469 of file cast.h.

◆ load()

bool load ( handle  src,
bool  convert 
)
inline

Definition at line 1446 of file cast.h.

◆ load_value()

bool load_value ( value_and_holder &&  v_h)
inlineprotected

Definition at line 1474 of file cast.h.

◆ operator holder_type &()

operator holder_type & ( )
inlineexplicit

Definition at line 1459 of file cast.h.

◆ operator holder_type *()

operator holder_type * ( )
inlineexplicit

Definition at line 1452 of file cast.h.

◆ operator type &()

operator type & ( )
inlineexplicit

Definition at line 1451 of file cast.h.

◆ operator type *()

operator type * ( )
inlineexplicit

Definition at line 1450 of file cast.h.

◆ try_direct_conversions()

static bool try_direct_conversions ( handle  )
inlinestaticprotected

Definition at line 1505 of file cast.h.

◆ try_implicit_casts() [1/2]

bool try_implicit_casts ( handle  ,
bool   
)
inlineprotected

Definition at line 1490 of file cast.h.

◆ try_implicit_casts() [2/2]

bool try_implicit_casts ( handle  src,
bool  convert 
)
inlineprotected

Definition at line 1493 of file cast.h.

Friends And Related Function Documentation

◆ type_caster_generic

friend class type_caster_generic
friend

Definition at line 1468 of file cast.h.

Member Data Documentation

◆ holder

holder_type holder
protected

Definition at line 1508 of file cast.h.


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