PythonQt
PythonQtArgumentFrame Class Reference

Stores C++ arguments for a qt_metacall (which are created when converting data from Python to C++). More...

#include <PythonQtMisc.h>

Public Member Functions

void reset ()
 Resets the pod and variant argument lists to empty lists.
QVariant * nextVariantPtr ()
 Get next pointer to a variant.
quint64 * nextPODPtr ()
 Get next pointer to a POD.
template<typename Class>
void * establishPersistentPtr (void *alreadyAllocatedPtr, const Class &value)
template<typename Class, typename ViewClass>
void * establishPersistentViewPtr (void *alreadyAllocatedPtr, const Class &value)

Static Public Member Functions

static PythonQtArgumentFrame * newFrame ()
 Create a new (empty) frame (which is typically reused from a freelist).
static void deleteFrame (PythonQtArgumentFrame *frame)
 Frees the frame (resetting it and putting it back to the freelist).
static void cleanupFreeList ()
 Frees all PythonQtArgumentFrame frames that are stored.

Detailed Description

Stores C++ arguments for a qt_metacall (which are created when converting data from Python to C++).

Definition at line 104 of file PythonQtMisc.h.

Member Function Documentation

◆ cleanupFreeList()

void PythonQtArgumentFrame::cleanupFreeList ( )
static

Frees all PythonQtArgumentFrame frames that are stored.

◆ deleteFrame()

void PythonQtArgumentFrame::deleteFrame ( PythonQtArgumentFrame * frame)
static

Frees the frame (resetting it and putting it back to the freelist).

◆ establishPersistentPtr()

template<typename Class>
void * PythonQtArgumentFrame::establishPersistentPtr ( void * alreadyAllocatedPtr,
const Class & value )
inline

Definition at line 125 of file PythonQtMisc.h.

126 {
127 if (alreadyAllocatedPtr) {
128 *reinterpret_cast<Class*>(alreadyAllocatedPtr) = value;
129 return alreadyAllocatedPtr;
130 } else {
131 QVariant* item = nextVariantPtr();
132 *item = QVariant(value);
133 return const_cast<void*>(item->constData());
134 }
135 }
QVariant * nextVariantPtr()
Get next pointer to a variant.

References nextVariantPtr().

◆ establishPersistentViewPtr()

template<typename Class, typename ViewClass>
void * PythonQtArgumentFrame::establishPersistentViewPtr ( void * alreadyAllocatedPtr,
const Class & value )
inline

Definition at line 138 of file PythonQtMisc.h.

139 {
140 QVariant* itemStore = nextVariantPtr();
141 *itemStore = QVariant(value);
142 if (alreadyAllocatedPtr) {
143 *reinterpret_cast<ViewClass*>(alreadyAllocatedPtr) =
144 ViewClass(*reinterpret_cast<const Class*>(itemStore->constData()));
145 return alreadyAllocatedPtr;
146 } else {
147 QVariant* item = nextVariantPtr();
148 *item = QVariant::fromValue(ViewClass(*reinterpret_cast<const Class*>(itemStore->constData())));
149 return const_cast<void*>(item->constData());
150 }
151 }

References nextVariantPtr().

◆ newFrame()

PythonQtArgumentFrame * PythonQtArgumentFrame::newFrame ( )
static

Create a new (empty) frame (which is typically reused from a freelist).

◆ nextPODPtr()

quint64 * PythonQtArgumentFrame::nextPODPtr ( )

Get next pointer to a POD.

◆ nextVariantPtr()

QVariant * PythonQtArgumentFrame::nextVariantPtr ( )

Get next pointer to a variant.

Referenced by establishPersistentPtr(), and establishPersistentViewPtr().

◆ reset()

void PythonQtArgumentFrame::reset ( )

Resets the pod and variant argument lists to empty lists.


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