CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch9/src/Fireworks/Core/interface/FWDetailView.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #ifndef Fireworks_Core_FWDetailView_h
00003 #define Fireworks_Core_FWDetailView_h
00004 
00005 #include <Reflex/Type.h>
00006 #include <string>
00007 #include <typeinfo>
00008 #include "Fireworks/Core/interface/FWModelId.h"
00009 #include "Fireworks/Core/interface/FWDetailViewBase.h"
00010 #include "Fireworks/Core/interface/FWDetailViewFactory.h"
00011 
00012 
00013 template<typename T>
00014 class FWDetailView : public FWDetailViewBase {
00015 public:
00016    FWDetailView() :
00017       FWDetailViewBase(typeid(T)) {
00018    }
00019 
00020    static std::string classTypeName() {
00021       return ROOT::Reflex::Type::ByTypeInfo(typeid(T)).Name(ROOT::Reflex::SCOPED);
00022    }
00023 
00024    static std::string classRegisterTypeName() {
00025       return typeid(T).name();
00026    }
00027 
00028 private:
00029    virtual void build(const FWModelId& iID, const void* iData) {
00030       setItem(iID.item());
00031       build(iID, reinterpret_cast<const T*> (iData));  
00032    }
00033 
00034    virtual void build(const FWModelId&, const T*) = 0;
00035    virtual void setTextInfo(const FWModelId&, const T*) = 0;
00036 };
00037 
00038 #endif