Panda3D
Loading...
Searching...
No Matches
paramPyObject.cxx
Go to the documentation of this file.
1/**
2 * PANDA 3D SOFTWARE
3 * Copyright (c) Carnegie Mellon University. All rights reserved.
4 *
5 * All use of this software is subject to the terms of the revised BSD
6 * license. You should have received a copy of this license along
7 * with this source code in a file named "LICENSE."
8 *
9 * @file paramPyObject.cxx
10 * @author rdb
11 * @date 2021-03-01
12 */
13
14#include "paramPyObject.h"
15
16TypeHandle ParamPyObject::_type_handle;
17
18/**
19 * Decrements the reference count.
20 */
21ParamPyObject::
22~ParamPyObject() {
23#if defined(HAVE_THREADS) && !defined(SIMPLE_THREADS)
24 PyGILState_STATE gstate;
25 gstate = PyGILState_Ensure();
26#endif
27
28 Py_DECREF(_value);
29
30#if defined(HAVE_THREADS) && !defined(SIMPLE_THREADS)
31 PyGILState_Release(gstate);
32#endif
33}
34
35/**
36 *
37 */
38void ParamPyObject::
39output(std::ostream &out) const {
40 out << "<" << Py_TYPE(_value)->tp_name
41 << " object at " << (void *)_value << ">";
42}
TypeHandle is the identifier used to differentiate C++ class types.
Definition typeHandle.h:81
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.