μHAL (v2.8.17)
Part of the IPbus software repository
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Static Public Member Functions | Static Private Member Functions | Private Attributes | List of all members
loader_life_support Class Reference

A life support system for temporary objects created by type_caster::load(). More...

#include </builds/ipbus/ipbus-software/uhal/python/pybind11-python2/include/pybind11/detail/type_caster_base.h>

Collaboration diagram for loader_life_support:
[legend]

Public Member Functions

 loader_life_support ()
 A new patient frame is created when a function is entered. More...
 
 ~loader_life_support ()
 ... and destroyed after it returns More...
 
 loader_life_support ()
 A new patient frame is created when a function is entered. More...
 
 ~loader_life_support ()
 ... and destroyed after it returns More...
 

Static Public Member Functions

static PYBIND11_NOINLINE void add_patient (handle h)
 This can only be used inside a pybind11-bound function, either by argument_loader at argument preparation time or by py::cast() at execution time. More...
 
static PYBIND11_NOINLINE void add_patient (handle h)
 This can only be used inside a pybind11-bound function, either by argument_loader at argument preparation time or by py::cast() at execution time. More...
 

Static Private Member Functions

static loader_life_support ** get_stack_pp ()
 
static loader_life_supportget_stack_top ()
 
static void set_stack_top (loader_life_support *value)
 
static loader_life_support ** get_stack_pp ()
 
static loader_life_supportget_stack_top ()
 
static void set_stack_top (loader_life_support *value)
 

Private Attributes

loader_life_supportparent = nullptr
 
std::unordered_set< PyObject * > keep_alive
 

Detailed Description

A life support system for temporary objects created by type_caster::load().

Adding a patient will keep it alive up until the enclosing function returns.

Definition at line 34 of file type_caster_base.h.

Constructor & Destructor Documentation

◆ loader_life_support() [1/2]

loader_life_support::loader_life_support ( )
inline

A new patient frame is created when a function is entered.

Definition at line 66 of file type_caster_base.h.

◆ ~loader_life_support() [1/2]

loader_life_support::~loader_life_support ( )
inline

... and destroyed after it returns

Definition at line 69 of file type_caster_base.h.

References pybind11_fail().

◆ loader_life_support() [2/2]

loader_life_support::loader_life_support ( )
inline

A new patient frame is created when a function is entered.

Definition at line 66 of file type_caster_base.h.

References set_stack_top().

◆ ~loader_life_support() [2/2]

loader_life_support::~loader_life_support ( )
inline

... and destroyed after it returns

Definition at line 69 of file type_caster_base.h.

References get_stack_top(), parent, pybind11_fail(), and set_stack_top().

Member Function Documentation

◆ add_patient() [1/2]

static PYBIND11_NOINLINE void loader_life_support::add_patient ( handle  h)
inlinestatic

This can only be used inside a pybind11-bound function, either by argument_loader at argument preparation time or by py::cast() at execution time.

Definition at line 81 of file type_caster_base.h.

References keep_alive, and handle::ptr().

Referenced by type_caster< Eigen::Ref< PlainObjectType, 0, StrideType >, enable_if_t< is_eigen_dense_map< Eigen::Ref< PlainObjectType, 0, StrideType > >::value > >::load(), string_caster< StringType, IsView >::load(), and type_caster_generic::load_impl().

◆ add_patient() [2/2]

static PYBIND11_NOINLINE void loader_life_support::add_patient ( handle  h)
inlinestatic

This can only be used inside a pybind11-bound function, either by argument_loader at argument preparation time or by py::cast() at execution time.

Definition at line 81 of file type_caster_base.h.

References get_stack_top(), keep_alive, and handle::ptr().

◆ get_stack_pp() [1/2]

static loader_life_support ** loader_life_support::get_stack_pp ( )
inlinestaticprivate

Definition at line 56 of file type_caster_base.h.

Referenced by get_stack_top(), and set_stack_top().

◆ get_stack_pp() [2/2]

static loader_life_support ** loader_life_support::get_stack_pp ( )
inlinestaticprivate

Definition at line 56 of file type_caster_base.h.

◆ get_stack_top() [1/2]

static loader_life_support * loader_life_support::get_stack_top ( )
inlinestaticprivate

Definition at line 60 of file type_caster_base.h.

Referenced by add_patient(), and ~loader_life_support().

◆ get_stack_top() [2/2]

static loader_life_support * loader_life_support::get_stack_top ( )
inlinestaticprivate

Definition at line 60 of file type_caster_base.h.

References get_stack_pp().

◆ set_stack_top() [1/2]

static void loader_life_support::set_stack_top ( loader_life_support value)
inlinestaticprivate

Definition at line 61 of file type_caster_base.h.

Referenced by loader_life_support(), and ~loader_life_support().

◆ set_stack_top() [2/2]

static void loader_life_support::set_stack_top ( loader_life_support value)
inlinestaticprivate

Definition at line 61 of file type_caster_base.h.

References get_stack_pp().

Member Data Documentation

◆ keep_alive

std::unordered_set< PyObject * > loader_life_support::keep_alive
private

Definition at line 37 of file type_caster_base.h.

Referenced by add_patient().

◆ parent

loader_life_support * loader_life_support::parent = nullptr
private

Definition at line 36 of file type_caster_base.h.

Referenced by ~loader_life_support().


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