QGeneralFactory.hh

Go to the documentation of this file.
00001 #ifndef _Q_GENERAL_FACTORY_HH_
00002 #define _Q_GENERAL_FACTORY_HH_
00003 
00023 #include <string>
00024 #include <list>
00025 #include <map>
00026 
00027 #include "QNamed.hh"
00028 #include "QBaseModuleFactory.hh"
00029 
00030 class QGlobalReaderFactory;
00031 class QGlobalReader;
00032 class QGlobalWriterFactory;
00033 class QGlobalWriter;
00034 class QModule;
00035 class QFilter;
00036 class QReader;
00037 class QWriter;
00038 class QDriver;
00039 
00040 class QSequence;
00041 class QDLLLoader;
00042 
00043 #define Q_PLUGIN_PREFIX_STR "registerInFactory"
00044 
00045 class QGeneralFactory : public QNamed {
00046     public:
00047         static QGeneralFactory& GetInstance();
00048 
00049         virtual ~QGeneralFactory();
00050         
00051         void LoadPlugin(const std::string& name);
00052 
00053         void RegisterGlobalReader(QGlobalReaderFactory* GRF);
00054         std::list<const QGlobalReaderFactory*> GetListOfGlobalReaders() const;
00055         QGlobalReader* CreateGlobalReader(const std::string& name);
00056 
00057         void RegisterGlobalWriter(QGlobalWriterFactory* GRF);
00058         std::list<const QGlobalWriterFactory*> GetListOfGlobalWriters() const;
00059         QGlobalWriter* CreateGlobalWriter(const std::string& name);
00060         
00061         void Register(QModFactory<QModule>* MF);
00062         QModule* CreateModule(const std::string& name, QSequence* s);
00063         
00064         void Register(QModFactory<QReader>* MF);
00065         QReader* CreateReader(const std::string& name, QSequence* s);
00066 
00067         void Register(QModFactory<QWriter>* MF);
00068         QWriter* CreateWriter(const std::string& name, QSequence* s);
00069 
00070         void Register(QModFactory<QFilter>* MF);
00071         QFilter* CreateFilter(const std::string& name, QSequence* s);
00072 
00073         void Register(QModFactory<QDriver>* MF);
00074         QDriver* CreateDriver(const std::string& name, QSequence* s);
00075 
00076    private:
00077         QGeneralFactory();
00078         QDLLLoader* fDLLLoader;
00079         
00080         std::map<std::string, QGlobalReaderFactory*> fGlobalReaders;
00081         std::map<std::string, QGlobalWriterFactory*> fGlobalWriters;
00082         std::map<std::string, QModFactory<QModule>* > fModules;
00083         std::map<std::string, QModFactory<QFilter>* > fFilters;
00084         std::map<std::string, QModFactory<QReader>* > fReaders;
00085         std::map<std::string, QModFactory<QWriter>* > fWriters;
00086         std::map<std::string, QModFactory<QDriver>* > fDrivers;
00087 
00088 };
00089 
00090 #endif

Generated on Fri Mar 6 13:40:39 2009 for CUORE Software by  doxygen 1.5.1