00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef _GEDDEI_PROCESSORFACTORY_H
00011 #define _GEDDEI_PROCESSORFACTORY_H
00012
00013 #ifdef __GEDDEI_BUILD
00014 #include "qfactorymanager.h"
00015 #include "processor.h"
00016 #else
00017 #include <qtextra/qfactorymanager.h>
00018 #include <geddei/processor.h>
00019 #endif
00020 using namespace Geddei;
00021
00022 namespace Geddei
00023 {
00024
00042 class ProcessorFactory
00043 {
00044 static QFactoryManager<Processor> *theOne;
00045 static QFactoryManager<Processor> &factory();
00046
00047 public:
00054 static const bool available(const QString &type) { return factory().isAvailable(type); }
00055
00063 static const int versionId(const QString &type) { return factory().getVersion(type); }
00064
00072 static QString version(const QString &type) { return QString::number(versionId(type) / 65536) + "." + QString::number((versionId(type) / 256) % 256) + "." + QString::number(versionId(type) % 256); }
00073
00080 static const QStringList available() { return factory().getAvailable(); }
00081
00088 static Processor *create(const QString &type);
00089 };
00090
00091 };
00092
00093 #endif