Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:27:01

0001 // -*- C++ -*-
0002 #ifndef Fireworks_Core_FWDetailView_h
0003 #define Fireworks_Core_FWDetailView_h
0004 
0005 #include "FWCore/Reflection/interface/TypeWithDict.h"
0006 #include <string>
0007 #include <typeinfo>
0008 #include "Fireworks/Core/interface/FWModelId.h"
0009 #include "Fireworks/Core/interface/FWDetailViewBase.h"
0010 #include "Fireworks/Core/interface/FWDetailViewFactory.h"
0011 
0012 template <typename T>
0013 class FWDetailView : public FWDetailViewBase {
0014 public:
0015   FWDetailView() : FWDetailViewBase(typeid(T)) {}
0016 
0017   static std::string classTypeName() { return edm::TypeWithDict(typeid(T)).name(); }
0018 
0019   static std::string classRegisterTypeName() { return typeid(T).name(); }
0020   virtual void build(const FWModelId&, const T*) = 0;
0021   virtual void setTextInfo(const FWModelId&, const T*) = 0;
0022 
0023   void build(const FWModelId& iID, const void* iData) override {
0024     setItem(iID.item());
0025     build(iID, reinterpret_cast<const T*>(iData));
0026   }
0027 };
0028 
0029 #endif