QGlobalRWFactory.hh
Go to the documentation of this file.00001 #ifndef _Q_GLOBALRW_FACTORY_HH_
00002 #define _Q_GLOBALRW_FACTORY_HH_
00003
00023 #include <string>
00024 #include <list>
00025 #include <map>
00026
00027 #include "QNamed.hh"
00028
00029 class QGlobalReaderFactory;
00030 class QGlobalReader;
00031 class QGlobalWriterFactory;
00032 class QGlobalWriter;
00033 class QDLLLoader;
00034
00035 #define Q_PLUGIN_PREFIX_STR "registerInFactory"
00036
00037 class QGlobalRWFactory : public QNamed {
00038 public:
00039 static QGlobalRWFactory& GetInstance();
00040
00041 virtual ~QGlobalRWFactory();
00042
00043 void LoadPlugin(const std::string& name);
00044
00045 void RegisterGlobalReader(QGlobalReaderFactory* GRF);
00046 std::list<const QGlobalReaderFactory*> GetListOfGlobalReaders() const;
00047 QGlobalReader* CreateGlobalReader(const std::string& name);
00048
00049 void RegisterGlobalWriter(QGlobalWriterFactory* GRF);
00050 std::list<const QGlobalWriterFactory*> GetListOfGlobalWriters() const;
00051 QGlobalWriter* CreateGlobalWriter(const std::string& name);
00052
00053 private:
00054 QGlobalRWFactory();
00055 QDLLLoader* fDLLLoader;
00056
00057 std::map<std::string, QGlobalReaderFactory*> fGlobalReaders;
00058 std::map<std::string, QGlobalWriterFactory*> fGlobalWriters;
00059 };
00060
00061 #endif