13 #ifndef BERRY_EXTENSION_TYPES_H
14 #define BERRY_EXTENSION_TYPES_H
39 typedef void (*Destructor)(QObject *);
40 typedef QObject* (*Constructor)();
48 static int registerType(
const char* typeName, Destructor destructor,
49 Constructor constructor);
56 static int registerTypedef(
const char* typeName,
int aliasId);
64 static void unregisterType(
const char* typeName);
73 static int type(
const char* typeName);
82 static const char* typeName(
int type);
91 static bool isRegistered(
int type);
99 static QObject* construct(
int type);
107 static void destroy(
int type, QObject* data);
110 template <
typename T>
116 template <
typename T>
122 template <
typename T>
128 template <
typename T>
137 template <typename T, bool Defined = ExtensionTypeId2<T>::Defined>
144 template <
typename T>
163 template <
typename T>
174 typedef QObject*(*ConstructPtr)(
const T*);
175 ConstructPtr cptr = extensionTypeConstructHelper<T>;
176 typedef void(*DeletePtr)(T*);
177 DeletePtr dptr = extensionTypeDeleteHelper<T>;
186 #endif // BERRY_EXTENSION_TYPES_H