Projekt

Allgemein

Profil

Herunterladen als
Herunterladen (952 Bytes) Statistiken
| Zweig: | Revision:
#ifndef ENTITYINSTANCEFACTORY_H
#define ENTITYINSTANCEFACTORY_H
#include <QString>
#include <QVariant>
#include <QHash>

namespace CuteEntityManager {
class Entity;
class EntityInstanceFactory {
public:
static Entity *createInstance(const char *className);
static Entity *createInstance(const QString &className);
static Entity *createInstance(int metaTypeId);
static Entity *createInstance(const char *className, const QHash<QString, QVariant> &attributes);
static Entity *setAttributes(Entity *e, const QHash<QString, QVariant> &attributes,
QHash<QString, QMetaProperty> metaprops);
static Entity *setAttributes(Entity *e, const QHash<QString, QVariant> &attributes);

template<typename T>
static Entity *createInstance() {
return EntityInstanceFactory::createInstance(qMetaTypeId<T>());
}
protected:
EntityInstanceFactory();
};
}
#endif // ENTITYINSTANCEFACTORY_H
(8-8/18)