23 #ifndef PYTHONITOMMETAOBJECT_H 24 #define PYTHONITOMMETAOBJECT_H 26 #include "../global.h" 28 #include <qbytearray.h> 29 #include <qmetaobject.h> 33 class MethodDescription;
34 typedef QList<MethodDescription> MethodDescriptionList;
39 PythonQObjectMarshal(QByteArray objName,
const char* className,
void *
object) : m_objName(objName), m_objectID(0), m_object(
object) { m_className = QByteArray(className); }
41 QByteArray m_className;
42 unsigned int m_objectID;
53 MethodDescription(QByteArray &name, QByteArray &signature, QMetaMethod::MethodType type, QMetaMethod::Access access,
int methodIndex,
int retType,
int nrOfArgs,
int *argTypes);
60 inline bool isValid()
const {
return (m_methodIndex >= 0); }
61 inline QMetaMethod::MethodType
type()
const {
return m_type; }
62 inline QMetaMethod::Access
access()
const {
return m_access; }
64 inline QByteArray
name()
const {
return m_name; }
65 inline int retType()
const {
return m_retType; }
66 inline int nrOfArgs()
const {
return m_nrOfArgs; }
67 inline int*
argTypes()
const {
return m_argTypes; }
68 inline QByteArray
signature()
const {
return m_signature; }
70 inline bool checkMethod(QByteArray &name,
int nrOfArgs)
const {
return (name == m_name && nrOfArgs == m_nrOfArgs); }
107 m_nrOfParams(nrOfParams),
108 m_sizeArgs(nrOfParams+1)
110 m_args =
new void*[m_sizeArgs];
111 m_argTypes =
new int[m_sizeArgs];
112 for(
int i=0;i<m_sizeArgs;i++)
126 for(
int i=0;i<m_sizeArgs;i++)
128 QMetaType::destroy(m_argTypes[i], m_args[i]);
130 DELETE_AND_SET_NULL_ARRAY(m_argTypes);
131 DELETE_AND_SET_NULL_ARRAY(m_args);
134 inline void** args() {
return m_args; };
147 if(m_args[0]) QMetaType::destroy(m_argTypes[0], m_args[0]);
148 m_argTypes[0] = type;
149 #if (QT_VERSION >= 0x050000) 150 m_args[0] = QMetaType::create(type, NULL);
152 m_args[0] = QMetaType::construct(type, NULL);
169 if((
int)index < 0 || (
int)index >= m_nrOfParams)
return;
170 if(m_args[index+1]) QMetaType::destroy(m_argTypes[index+1], m_args[index+1]);
171 m_args[index+1] = ptr;
172 m_argTypes[index+1] = type;
186 #endif // PYTHONITOMMETAOBJECT_H bool isValid() const
Definition: pythonItomMetaObject.h:60
int m_nrOfArgs
Definition: pythonItomMetaObject.h:79
int retType() const
Definition: pythonItomMetaObject.h:65
QMetaMethod::Access access() const
Definition: pythonItomMetaObject.h:62
void setParamArg(unsigned int index, void *ptr, int type)
stores a pair of variable-type and corresponding void-pointer as parameter with given index number ...
Definition: pythonItomMetaObject.h:167
int * argTypes() const
Definition: pythonItomMetaObject.h:67
int m_nrOfParams
Definition: pythonItomMetaObject.h:177
int * m_argTypes
Definition: pythonItomMetaObject.h:181
FctCallParamContainer(int nrOfParams)
constructor
Definition: pythonItomMetaObject.h:106
void ** m_args
Definition: pythonItomMetaObject.h:180
QMetaMethod::MethodType type() const
Definition: pythonItomMetaObject.h:61
Definition: apiFunctionsGraph.cpp:39
int * argTypes()
Definition: pythonItomMetaObject.h:135
Small wrapper class with all necessary information for any method, signal or slot of class which shou...
Definition: pythonItomMetaObject.h:49
QByteArray signature() const
Definition: pythonItomMetaObject.h:68
QByteArray m_name
Definition: pythonItomMetaObject.h:73
void initRetArg(int type)
initializes the return value
Definition: pythonItomMetaObject.h:145
int m_methodIndex
Definition: pythonItomMetaObject.h:74
each instance of this class contains the parameters (including return parameter) for any function cal...
Definition: pythonItomMetaObject.h:96
int m_retType
Definition: pythonItomMetaObject.h:78
~FctCallParamContainer()
destructor
Definition: pythonItomMetaObject.h:124
QMetaMethod::Access m_access
Definition: pythonItomMetaObject.h:77
int getRetType() const
Definition: pythonItomMetaObject.h:136
int m_sizeArgs
Definition: pythonItomMetaObject.h:179
int nrOfArgs() const
Definition: pythonItomMetaObject.h:66
int * m_argTypes
Definition: pythonItomMetaObject.h:80
int methodIndex() const
Definition: pythonItomMetaObject.h:63
QByteArray m_signature
Definition: pythonItomMetaObject.h:75
QMetaMethod::MethodType m_type
Definition: pythonItomMetaObject.h:76
QByteArray name() const
Definition: pythonItomMetaObject.h:64
Definition: pythonItomMetaObject.h:36