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>
125 enum { Defined = 0 };
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>;
180 reinterpret_cast<ExtensionType::Constructor>(cptr));
186 #endif // BERRY_EXTENSION_TYPES_H
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)
int registerExtensionType(const char *typeName, T *dummy=nullptr)
static int extensiontype_id()
void extensionTypeDeleteHelper(T *t)
static int registerTypedef(const char *typeName, int aliasId)