Diana Software
QTObjectHandle.hh
Go to the documentation of this file.
1 #ifndef _Q_TOBJECT_HANDLE_HH_
2 #define _Q_TOBJECT_HANDLE_HH_
11 #include "QGlobalHandle.hh"
12 #include "QTObject.hh"
13 
14 template<class T> class QTObjectHandle : public Diana::GlobalHandle<Diana::QTObject<T> >
15 {
16  public:
17  QTObjectHandle(const std::string& name) : Diana::GlobalHandle<Diana::QTObject<T> >(name)
18  {
19  }
20 
21  void Set(const T& obj)
22  {
23  Diana::QTObject<T> qobj(obj);
24  Diana::GlobalHandle<Diana::QTObject<T> >::Set(qobj);
25  }
26  const T& Get() const
27  {
28  return Diana::GlobalHandle<Diana::QTObject<T> >::Get().fObject;
29  }
30 
31 
32 
33 
34  // ClassDef QTObjectHandle
35 };
36 
37 #endif
template class to handle diana global QObject with QGlobalDataManager
global handle for generic TObject
QTObjectHandle(const std::string &name)
void Set(const T &obj)
const T & Get() const
QObject with TObject member.
Definition: QTObject.hh:38
the Diana namespace is needed because sometimes we use Qt libraries, that use same class names of our...