Panda3D
Loading...
Searching...
No Matches
Macros | Functions
py_panda.I File Reference

Go to the source code of this file.

Macros

#define _IS_FINAL(T)   (0)
 

Functions

void Dtool_Assign_PyObject (PyObject *&ptr, PyObject *value)
 Utility function for assigning a PyObject pointer while managing refcounts.
 
bool Dtool_CheckNoArgs (PyObject *args)
 Checks that the tuple is empty.
 
bool Dtool_CheckNoArgs (PyObject *args, PyObject *kwds)
 Checks that the tuple is empty, and that the dict is empty or NULL.
 
template<class T >
PyObject * DTool_CreatePyInstance (const T *obj, bool memory_rules)
 These functions wrap a pointer for a class that defines get_type_handle().
 
template<class T >
PyObject * DTool_CreatePyInstance (T *obj, bool memory_rules)
 
template<class T >
PyObject * DTool_CreatePyInstanceTyped (const T *obj, bool memory_rules)
 
template<class T >
PyObject * DTool_CreatePyInstanceTyped (T *obj, bool memory_rules)
 
long Dtool_EnumValue_AsLong (PyObject *value)
 Converts the enum value to a C long.
 
int DTool_PyInit_Finalize (PyObject *self, void *local_this, Dtool_PyTypedObject *type, bool memory_rules, bool is_const)
 Finishes initializing the Dtool_PyInstDef.
 
PyObject * Dtool_WrapValue (bool value)
 
PyObject * Dtool_WrapValue (char value)
 
PyObject * Dtool_WrapValue (const char *value)
 
template<class T1 , class T2 >
PyObject * Dtool_WrapValue (const std::pair< T1, T2 > &value)
 
PyObject * Dtool_WrapValue (const std::string &value)
 
PyObject * Dtool_WrapValue (const std::string *value)
 
PyObject * Dtool_WrapValue (const std::wstring &value)
 
PyObject * Dtool_WrapValue (const std::wstring *value)
 
PyObject * Dtool_WrapValue (const vector_uchar &value)
 
PyObject * Dtool_WrapValue (const wchar_t *value)
 
PyObject * Dtool_WrapValue (double value)
 
PyObject * Dtool_WrapValue (int value)
 The following functions wrap an arbitrary C++ value into a PyObject.
 
PyObject * Dtool_WrapValue (long long value)
 
PyObject * Dtool_WrapValue (long value)
 
PyObject * Dtool_WrapValue (PyObject *value)
 
PyObject * Dtool_WrapValue (std::nullptr_t)
 
PyObject * Dtool_WrapValue (unsigned int value)
 
PyObject * Dtool_WrapValue (unsigned long long value)
 
PyObject * Dtool_WrapValue (unsigned long value)
 
PyObject * Dtool_WrapValue (wchar_t value)
 
int DtoolInstance_ComparePointers (PyObject *v1, PyObject *v2)
 Python 2-style comparison function that compares objects by pointer.
 
template<class T >
bool DtoolInstance_GetPointer (PyObject *self, T *&into)
 Template function that can be used to extract any TypedObject pointer from a wrapped Python object.
 
template<class T >
bool DtoolInstance_GetPointer (PyObject *self, T *&into, Dtool_PyTypedObject &target_class)
 Template function that can be used to extract any TypedObject pointer from a wrapped Python object.
 
Py_hash_t DtoolInstance_HashPointer (PyObject *self)
 Function to create a hash from a wrapped Python object.
 
PyObject * DtoolInstance_RichComparePointers (PyObject *v1, PyObject *v2, int op)
 Rich comparison function that compares objects by pointer.
 

Detailed Description

Author
rdb
Date
2016-06-06

Definition in file py_panda.I.

Macro Definition Documentation

◆ _IS_FINAL

#define _IS_FINAL ( T)    (0)

Definition at line 12 of file py_panda.I.

Function Documentation

◆ Dtool_Assign_PyObject()

void Dtool_Assign_PyObject ( PyObject *& ptr,
PyObject * value )
inline

Utility function for assigning a PyObject pointer while managing refcounts.

Definition at line 97 of file py_panda.I.

◆ Dtool_CheckNoArgs() [1/2]

bool Dtool_CheckNoArgs ( PyObject * args)
inline

Checks that the tuple is empty.

Definition at line 167 of file py_panda.I.

◆ Dtool_CheckNoArgs() [2/2]

bool Dtool_CheckNoArgs ( PyObject * args,
PyObject * kwds )
inline

Checks that the tuple is empty, and that the dict is empty or NULL.

Definition at line 175 of file py_panda.I.

◆ DTool_CreatePyInstance() [1/2]

template<class T >
PyObject * DTool_CreatePyInstance ( const T * obj,
bool memory_rules )
inline

These functions wrap a pointer for a class that defines get_type_handle().

Definition at line 124 of file py_panda.I.

References DTool_CreatePyInstance().

Referenced by DTool_CreatePyInstance().

◆ DTool_CreatePyInstance() [2/2]

template<class T >
PyObject * DTool_CreatePyInstance ( T * obj,
bool memory_rules )
inline

Definition at line 131 of file py_panda.I.

◆ DTool_CreatePyInstanceTyped() [1/2]

template<class T >
PyObject * DTool_CreatePyInstanceTyped ( const T * obj,
bool memory_rules )
inline

Definition at line 138 of file py_panda.I.

◆ DTool_CreatePyInstanceTyped() [2/2]

template<class T >
PyObject * DTool_CreatePyInstanceTyped ( T * obj,
bool memory_rules )
inline

Definition at line 145 of file py_panda.I.

◆ Dtool_EnumValue_AsLong()

long Dtool_EnumValue_AsLong ( PyObject * value)
inline

Converts the enum value to a C long.

Definition at line 109 of file py_panda.I.

◆ DTool_PyInit_Finalize()

int DTool_PyInit_Finalize ( PyObject * self,
void * local_this,
Dtool_PyTypedObject * type,
bool memory_rules,
bool is_const )
inline

Finishes initializing the Dtool_PyInstDef.

Definition at line 155 of file py_panda.I.

◆ Dtool_WrapValue() [1/20]

PyObject * Dtool_WrapValue ( bool value)
inline

Definition at line 239 of file py_panda.I.

◆ Dtool_WrapValue() [2/20]

PyObject * Dtool_WrapValue ( char value)
inline

Definition at line 305 of file py_panda.I.

◆ Dtool_WrapValue() [3/20]

PyObject * Dtool_WrapValue ( const char * value)
inline

Definition at line 249 of file py_panda.I.

◆ Dtool_WrapValue() [4/20]

template<class T1 , class T2 >
PyObject * Dtool_WrapValue ( const std::pair< T1, T2 > & value)
inline

Definition at line 345 of file py_panda.I.

◆ Dtool_WrapValue() [5/20]

PyObject * Dtool_WrapValue ( const std::string & value)
inline

Definition at line 271 of file py_panda.I.

◆ Dtool_WrapValue() [6/20]

PyObject * Dtool_WrapValue ( const std::string * value)
inline

Definition at line 283 of file py_panda.I.

◆ Dtool_WrapValue() [7/20]

PyObject * Dtool_WrapValue ( const std::wstring & value)
inline

Definition at line 279 of file py_panda.I.

◆ Dtool_WrapValue() [8/20]

PyObject * Dtool_WrapValue ( const std::wstring * value)
inline

Definition at line 296 of file py_panda.I.

◆ Dtool_WrapValue() [9/20]

PyObject * Dtool_WrapValue ( const vector_uchar & value)
inline

Definition at line 326 of file py_panda.I.

◆ Dtool_WrapValue() [10/20]

PyObject * Dtool_WrapValue ( const wchar_t * value)
inline

Definition at line 262 of file py_panda.I.

◆ Dtool_WrapValue() [11/20]

PyObject * Dtool_WrapValue ( double value)
inline

Definition at line 245 of file py_panda.I.

◆ Dtool_WrapValue() [12/20]

PyObject * Dtool_WrapValue ( int value)
inline

The following functions wrap an arbitrary C++ value into a PyObject.

Definition at line 183 of file py_panda.I.

◆ Dtool_WrapValue() [13/20]

PyObject * Dtool_WrapValue ( long long value)
inline

Definition at line 223 of file py_panda.I.

◆ Dtool_WrapValue() [14/20]

PyObject * Dtool_WrapValue ( long value)
inline

Definition at line 205 of file py_panda.I.

◆ Dtool_WrapValue() [15/20]

PyObject * Dtool_WrapValue ( PyObject * value)
inline

Definition at line 322 of file py_panda.I.

◆ Dtool_WrapValue() [16/20]

PyObject * Dtool_WrapValue ( std::nullptr_t )
inline

Definition at line 317 of file py_panda.I.

◆ Dtool_WrapValue() [17/20]

PyObject * Dtool_WrapValue ( unsigned int value)
inline

Definition at line 191 of file py_panda.I.

◆ Dtool_WrapValue() [18/20]

PyObject * Dtool_WrapValue ( unsigned long long value)
inline

Definition at line 227 of file py_panda.I.

◆ Dtool_WrapValue() [19/20]

PyObject * Dtool_WrapValue ( unsigned long value)
inline

Definition at line 213 of file py_panda.I.

◆ Dtool_WrapValue() [20/20]

PyObject * Dtool_WrapValue ( wchar_t value)
inline

Definition at line 313 of file py_panda.I.

◆ DtoolInstance_ComparePointers()

int DtoolInstance_ComparePointers ( PyObject * v1,
PyObject * v2 )
inline

Python 2-style comparison function that compares objects by pointer.

Definition at line 75 of file py_panda.I.

Referenced by DtoolInstance_RichComparePointers().

◆ DtoolInstance_GetPointer() [1/2]

template<class T >
bool DtoolInstance_GetPointer ( PyObject * self,
T *& into )
inline

Template function that can be used to extract any TypedObject pointer from a wrapped Python object.

Definition at line 20 of file py_panda.I.

◆ DtoolInstance_GetPointer() [2/2]

template<class T >
bool DtoolInstance_GetPointer ( PyObject * self,
T *& into,
Dtool_PyTypedObject & target_class )
inline

Template function that can be used to extract any TypedObject pointer from a wrapped Python object.

In this case, the Dtool_PyTypedObject is known.

Definition at line 45 of file py_panda.I.

◆ DtoolInstance_HashPointer()

Py_hash_t DtoolInstance_HashPointer ( PyObject * self)
inline

Function to create a hash from a wrapped Python object.

Definition at line 65 of file py_panda.I.

◆ DtoolInstance_RichComparePointers()

PyObject * DtoolInstance_RichComparePointers ( PyObject * v1,
PyObject * v2,
int op )
inline

Rich comparison function that compares objects by pointer.

Definition at line 88 of file py_panda.I.

References DtoolInstance_ComparePointers().