HepMC3 event record library
Public Member Functions | Data Fields | Protected Member Functions | Protected Attributes
generic_type Class Reference

Generic support for creating new Python heap types. More...

#include <pybind11.h>

+ Inheritance diagram for generic_type:
+ Collaboration diagram for generic_type:

Public Member Functions

 PYBIND11_DEPRECATED ("Use reinterpret_borrow<object>() or reinterpret_steal<object>()") object(handle h
 
handle release ()
 
template<typename T >
cast () const &
 
template<typename T >
cast ()&&
 
PyObject * ptr () const
 Return the underlying PyObject * pointer. More...
 
PyObject *& ptr ()
 
const handleinc_ref () const &
 
const handledec_ref () const &
 
 operator bool () const
 Return true when the handle wraps a valid Python object. More...
 
bool operator== (const handle &h) const
 
bool operator!= (const handle &h) const
 
bool check () const
 

Data Fields

bool is_borrowed: handle(h) { if (is_borrowed) inc_ref()
 

Protected Member Functions

void initialize (const type_record &rec)
 
void mark_parents_nonsimple (PyTypeObject *value)
 Helper function which tags all parents of a type using mult. inheritance. More...
 
void install_buffer_funcs (buffer_info *(*get_buffer)(PyObject *, void *), void *get_buffer_data)
 
void def_property_static_impl (const char *name, handle fget, handle fset, detail::function_record *rec_func)
 

Protected Attributes

PyObject * m_ptr = nullptr
 

Detailed Description

Generic support for creating new Python heap types.

Definition at line 1029 of file pybind11.h.

Member Function Documentation

const handle& dec_ref ( ) const
inlineinherited
\rst
Manually decrease the reference count of the Python object. Usually, it is
preferable to use the `object` class which derives from `handle` and calls
this function automatically. Returns a reference to itself.

Definition at line 199 of file pytypes.h.

const handle& inc_ref ( ) const
inlineinherited
\rst
Manually increase the reference count of the Python object. Usually, it is
preferable to use the `object` class which derives from `handle` and calls
this function automatically. Returns a reference to itself.

Definition at line 192 of file pytypes.h.

void mark_parents_nonsimple ( PyTypeObject *  value)
inlineprotected

Helper function which tags all parents of a type using mult. inheritance.

Definition at line 1085 of file pybind11.h.

operator bool ( ) const
inlineexplicitinherited

Return true when the handle wraps a valid Python object.

Definition at line 207 of file pytypes.h.

bool operator== ( const handle h) const
inlineinherited
\rst
Deprecated: Check that the underlying pointers are the same.
Equivalent to ``obj1 is obj2`` in Python.

Definition at line 213 of file pytypes.h.

PyObject* ptr ( ) const
inlineinherited

Return the underlying PyObject * pointer.

Definition at line 184 of file pytypes.h.

handle release ( )
inlineinherited
\rst
Resets the internal pointer to ``nullptr`` without decreasing the
object's reference count. The function returns a raw handle to the original
Python object.

Definition at line 249 of file pytypes.h.

References handle::handle().


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