each instance of this class contains the parameters (including return parameter) for any function call, which is parsed by the Qt-signal-slot system. This class is especially used for wrapping function calls between C++ and any python method. The convention for the main member variables corresponds to the usual Qt-way to wrap such function calls.
More...
#include <pythonItomMetaObject.h>
each instance of this class contains the parameters (including return parameter) for any function call, which is parsed by the Qt-signal-slot system. This class is especially used for wrapping function calls between C++ and any python method. The convention for the main member variables corresponds to the usual Qt-way to wrap such function calls.
Each parameter is stored in this container using the construct and destroy method of QMetaType. The result of deeply copying a variable by QMetaType::construct is a void* containing the deep-copy and the corresponding type-id (integer). Both are then saved in a void* and int-array in the corresponding order. The first value of these arrays is always reserved for the return value. If the return value is of type void, the type-id of the first element is equal to zero.
◆ FctCallParamContainer()
ito::FctCallParamContainer::FctCallParamContainer |
( |
int | nrOfParams | ) |
|
|
inline |
constructor
initializes the FctCallParamContainer with a given number of arguments. Each argument is not allocated, hence each value in m_argTypes is set to -1 and each value in m_args is set to NULL.
- Parameters
-
nrOfParams | is the number of arguments (without return value) for the corresponding method / function |
◆ ~FctCallParamContainer()
ito::FctCallParamContainer::~FctCallParamContainer |
( |
| ) |
|
|
inline |
destructor
Each value in m_args is destroyed using QMetaType::destroy, since this FctCallParamContainer always holds a deep copy of each parameter.
◆ argTypes()
int * ito::FctCallParamContainer::argTypes |
( |
| ) |
|
|
inline |
◆ getRetType()
int ito::FctCallParamContainer::getRetType |
( |
| ) |
const |
|
inline |
◆ initRetArg()
void ito::FctCallParamContainer::initRetArg |
( |
int | type | ) |
|
|
inline |
initializes the return value
returns type of return value
At first, an existing return value is deleted and then the new return value given by type is created. The value is always the default type of this argument.
- Parameters
-
type | is the desired type-id of the default value which is assumed as return type |
◆ setParamArg()
void ito::FctCallParamContainer::setParamArg |
( |
unsigned int | index, |
|
|
void * | ptr, |
|
|
int | type ) |
|
inline |
stores a pair of variable-type and corresponding void-pointer as parameter with given index number
At first any existing parameter at the given index position is deleted. Then the new value is saved. Consider, that no further deep copy of the new variable is created, hence, the reference to the void-pointer is stolen and will be deleted by this FctCallParamContainer. You can create an appropriate pair of void-pointer and type-id using QMetaType::construct.
- Parameters
-
index | is the parameter index (zero-based) |
ptr | is the void-pointer with the internal data of the parameter |
type | is the corresponding type-id with respect to QMetaType |
◆ m_args
void** ito::FctCallParamContainer::m_args |
|
private |
void*-array containing the data of each parameter, NULL if the parameter is not available / filled (yet)
◆ m_argTypes
int* ito::FctCallParamContainer::m_argTypes |
|
private |
int-array with the corresponding type-id's for each parameter in m_args
◆ m_nrOfParams
int ito::FctCallParamContainer::m_nrOfParams |
|
private |
◆ m_sizeArgs
int ito::FctCallParamContainer::m_sizeArgs |
|
private |
number of arguments + 1 (for return value), hence length of m_args and m_argTypes
The documentation for this class was generated from the following file: