17 #ifndef BERRY_EXTENSION_TYPES_H
18 #define BERRY_EXTENSION_TYPES_H
44 typedef void (*Destructor)(QObject *);
45 typedef QObject* (*Constructor)();
53 static int registerType(
const char* typeName, Destructor destructor,
54 Constructor constructor);
61 static int registerTypedef(
const char* typeName,
int aliasId);
69 static void unregisterType(
const char* typeName);
78 static int type(
const char* typeName);
87 static const char* typeName(
int type);
96 static bool isRegistered(
int type);
104 static QObject* construct(
int type);
112 static void destroy(
int type, QObject* data);
115 template <
typename T>
121 template <
typename T>
127 template <
typename T>
133 template <
typename T>
142 template <typename T, bool Defined = ExtensionTypeId2<T>::Defined>
149 template <
typename T>
169 template <
typename T>
180 typedef QObject*(*ConstructPtr)(
const T*);
181 ConstructPtr cptr = extensionTypeConstructHelper<T>;
182 typedef void(*DeletePtr)(T*);
183 DeletePtr dptr = extensionTypeDeleteHelper<T>;
186 reinterpret_cast<ExtensionType::Constructor>(cptr));
192 #endif // BERRY_EXTENSION_TYPES_H
int registerExtensionType(const char *typeName, T *dummy=0)
static int extensiontype_id()
#define org_blueberry_core_runtime_EXPORT
The ExtensionType class manages named types .
QObject * extensionTypeConstructHelper(const T *)
static int extensiontype_id()
static int registerType(const char *typeName, Destructor destructor, Constructor constructor)
static int extensiontype_id()
void extensionTypeDeleteHelper(T *t)
static int registerTypedef(const char *typeName, int aliasId)