eVaf
registry.h
Go to the documentation of this file.
1 
20 #ifndef __COMMON_REGISTRY_H
21 #define __COMMON_REGISTRY_H
22 
23 #include "iregistry.h"
24 
25 #include <QObject>
26 #include <QString>
27 #include <QHash>
28 
29 namespace eVaf {
30 namespace Common {
31 namespace Internal {
32 
39 class Registry : public iRegistry
40 {
41  Q_OBJECT
42 
43 public:
44 
45  Registry();
46 
47  virtual ~Registry();
48 
49  /*
50  iRegistry interface
51  */
52 
53  virtual bool registerInterface(QString const & name, QObject * obj);
54 
55  virtual QObject * queryInterface(QString const & name) const;
56 
57 
58 private:
59 
61  typedef QHash<QString, QObject *> Interfaces;
62  Interfaces mInterfaces;
63 
64 
65 private slots:
66 
69  void interfaceDestroyed(QObject * obj = 0);
70 
71 };
72 
73 } // namespace eVaf::Common::Internal
74 } // namespace eVaf::Common
75 } // namespace eVaf
76 
77 #endif // registry.h
Common registry for interfaces.
virtual bool registerInterface(QString const &name, QObject *obj)
Registers an interface.
virtual QObject * queryInterface(QString const &name) const
Returns the interface by its name.
iRegistry interface implementation.
Definition: registry.h:39
Global eVaf namespace.
Definition: engine.h:37
Common registry for interfaces.
Definition: iregistry.h:67