Diana Software
QGlobalRWFactory.hh
Go to the documentation of this file.
1 #ifndef _Q_GLOBALRW_FACTORY_HH_
2 #define _Q_GLOBALRW_FACTORY_HH_
23 #include <string>
24 #include <list>
25 #include <map>
26 
27 #include "QNamed.hh"
28 
30 class QGlobalReader;
32 class QGlobalWriter;
33 namespace Diana {class QDLLLoader;};
34 
35 #define Q_PLUGIN_PREFIX_STR "registerInFactory"
36 
37 class QGlobalRWFactory : public QNamed {
38  public:
39  static QGlobalRWFactory& GetInstance();
40 
41  virtual ~QGlobalRWFactory();
42 
43  void LoadPlugin(const std::string& name);
44 
46  std::list<const QGlobalReaderFactory*> GetListOfGlobalReaders() const;
47  QGlobalReader* CreateGlobalReader(const std::string& name);
48 
50  std::list<const QGlobalWriterFactory*> GetListOfGlobalWriters() const;
51  QGlobalWriter* CreateGlobalWriter(const std::string& name);
52 
53  private:
55  Diana::QDLLLoader* fDLLLoader;
56 
57  std::map<std::string, QGlobalReaderFactory*> fGlobalReaders;
58  std::map<std::string, QGlobalWriterFactory*> fGlobalWriters;
59 
60  // MV FIXME used by the makefile to trigger LinkDef
61  // ClassDef(QGlobalRWFactory,1);
62 };
63 
64 #endif
This class take care of plugin registration and creation.
std::list< const QGlobalReaderFactory * > GetListOfGlobalReaders() const
std::list< const QGlobalWriterFactory * > GetListOfGlobalWriters() const
std::map< std::string, QGlobalReaderFactory * > fGlobalReaders
QGlobalReader * CreateGlobalReader(const std::string &name)
Diana::QDLLLoader * fDLLLoader
static QGlobalRWFactory & GetInstance()
virtual ~QGlobalRWFactory()
std::map< std::string, QGlobalWriterFactory * > fGlobalWriters
void RegisterGlobalReader(QGlobalReaderFactory *GRF)
void LoadPlugin(const std::string &name)
QGlobalWriter * CreateGlobalWriter(const std::string &name)
void RegisterGlobalWriter(QGlobalWriterFactory *GRF)
abstract factory for QGlobalReader.
Abstract class for global readers.
abstract factory for QGlobalWriter.
Abstract class for global writers.
base class for anything that has a name
Definition: QNamed.hh:14
the Diana namespace is needed because sometimes we use Qt libraries, that use same class names of our...