processorfactory.h

00001 /***************************************************************************
00002  *   Copyright (C) 2003 by Gav Wood                                        *
00003  *   gav@cs.york.ac.uk                                                     *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU Library General Public License as       *
00007  *   published by the Free Software Foundation; either version 2 of the    *
00008  *   License, or (at your option) any later version.                       *
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

Generated on Fri Nov 10 21:58:26 2006 for Exscalibar by  doxygen 1.5.1