ChirpSim
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros
physicalobjectfactory.h
Go to the documentation of this file.
1 #ifndef PHYSICALOBJECTFACTORY_H
2 #define PHYSICALOBJECTFACTORY_H
3 
4 #include <QObject>
5 #include <QMap>
6 #include <QJsonObject>
8 #include "world.h"
9 
14 typedef PhysicalObject* FactoryFunction(World *, const QJsonObject&);
15 
19 class PhysicalObjectFactory : public QObject
20 {
21  Q_OBJECT
22 
23 
24 public:
30  void addFactory(const QString& name, FactoryFunction factoryFunction);
31 
37  FactoryFunction *getFactory(const QString& name);
38 
43 signals:
44 
45 public slots:
46 
47 private:
48  explicit PhysicalObjectFactory();
49 
51 
52  QMap<QString, FactoryFunction*> _map;
53 };
54 
55 #endif // PHYSICALOBJECTFACTORY_H