HepMC3 event record library
Public Member Functions | Static Public Member Functions | Data Fields | Protected Attributes | Private Member Functions | Static Private Member Functions
dtype Class Reference
+ Inheritance diagram for dtype:
+ Collaboration diagram for dtype:

Public Member Functions

 PYBIND11_OBJECT_DEFAULT (dtype, object, detail::npy_api::get().PyArrayDescr_Check_)
 
 dtype (const buffer_info &info)
 
 dtype (const std::string &format)
 
 dtype (const char *format)
 
 dtype (list names, list formats, list offsets, ssize_t itemsize)
 
ssize_t itemsize () const
 Size of the data type in bytes. More...
 
bool has_fields () const
 Returns true for structured data types. More...
 
char kind () const
 Single-character type code. More...
 
 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
 

Static Public Member Functions

static dtype from_args (object args)
 This is essentially the same as calling numpy.dtype(args) in Python. More...
 
template<typename T >
static dtype of ()
 Return dtype associated with a C++ type. More...
 

Data Fields

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

Protected Attributes

PyObject * m_ptr = nullptr
 

Private Member Functions

dtype strip_padding (ssize_t itemsize)
 

Static Private Member Functions

static object _dtype_from_pep3118 ()
 

Detailed Description

Definition at line 462 of file numpy.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.

static dtype from_args ( object  args)
inlinestatic

This is essentially the same as calling numpy.dtype(args) in Python.

Definition at line 488 of file numpy.h.

References handle::ptr().

bool has_fields ( ) const
inline

Returns true for structured data types.

Definition at line 506 of file numpy.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.

ssize_t itemsize ( ) const
inline

Size of the data type in bytes.

Definition at line 501 of file numpy.h.

char kind ( ) const
inline

Single-character type code.

Definition at line 511 of file numpy.h.

static dtype of ( )
inlinestatic

Return dtype associated with a C++ type.

Definition at line 496 of file numpy.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: