Toggle main menu visibility
Main Page
Classes
Class List
Class Hierarchy
Class Members
All
a
b
c
d
e
f
g
i
k
l
m
n
o
p
r
s
t
u
v
w
z
~
Functions
a
b
c
d
e
f
g
i
k
l
m
n
o
p
r
s
t
u
v
w
z
~
Variables
Typedefs
Files
File List
File Members
All
a
b
c
d
e
f
i
k
l
m
n
q
r
s
t
u
v
Functions
a
c
d
e
f
m
s
t
u
Variables
b
c
d
e
f
i
k
n
q
r
s
t
u
v
Typedefs
Macros
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Macros
Pages
Loading...
Searching...
No Matches
util.h
Go to the documentation of this file.
1
// BSD 3-Clause License; see https://github.com/scikit-hep/awkward/blob/main/LICENSE
2
3
#ifndef AWKWARDPY_UTIL_H_
4
#define AWKWARDPY_UTIL_H_
5
6
#include <pybind11/pybind11.h>
7
#include <pybind11/numpy.h>
8
25
template
<
typename
T>
26
class
pyobject_deleter
{
27
public
:
29
pyobject_deleter
(PyObject *pyobj): pyobj_(pyobj) {
30
Py_INCREF(pyobj_);
31
}
29
pyobject_deleter
(PyObject *pyobj): pyobj_(pyobj) {
…
}
32
34
void
operator()
(T
const
*
/* p */
) {
35
Py_DECREF(pyobj_);
36
}
34
void
operator()
(T
const
*
/* p */
) {
…
}
37
private
:
39
PyObject* pyobj_;
40
};
26
class
pyobject_deleter
{
…
};
41
42
#endif
// AWKWARDPY_UTIL_H_
pyobject_deleter::operator()
void operator()(T const *)
Called by std::shared_ptr when its reference count reaches zero.
Definition
util.h:34
pyobject_deleter::pyobject_deleter
pyobject_deleter(PyObject *pyobj)
Creates a pyobject_deleter and calls Py_INCREF(ptr).
Definition
util.h:29
include
awkward
python
util.h
Generated by
1.13.2