Go to the documentation of this file.00001 #ifndef Fireworks_Core_FWSimpleProxyBuilderTemplate_h
00002 #define Fireworks_Core_FWSimpleProxyBuilderTemplate_h
00003
00004
00005
00006
00007
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #include "Fireworks/Core/interface/FWSimpleProxyBuilder.h"
00026
00027
00028
00029 template <typename T>
00030 class FWSimpleProxyBuilderTemplate : public FWSimpleProxyBuilder {
00031
00032 public:
00033 FWSimpleProxyBuilderTemplate() :
00034 FWSimpleProxyBuilder(typeid(T)) {
00035 }
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045 protected:
00046 const T& modelData(int index) { return *reinterpret_cast<const T*>(m_helper.offsetObject(item()->modelData(index))); }
00047
00048 private:
00049 FWSimpleProxyBuilderTemplate(const FWSimpleProxyBuilderTemplate&);
00050
00051 const FWSimpleProxyBuilderTemplate& operator=(const FWSimpleProxyBuilderTemplate&);
00052
00053 virtual void build(const void*iData, unsigned int iIndex, TEveElement& oItemHolder, const FWViewContext* context)
00054 {
00055 if(0!=iData) {
00056 build(*reinterpret_cast<const T*> (iData), iIndex, oItemHolder, context);
00057 }
00058 }
00059
00060 virtual void buildViewType(const void*iData, unsigned int iIndex, TEveElement& oItemHolder, FWViewType::EType viewType, const FWViewContext* context)
00061 {
00062 if(0!=iData) {
00063 buildViewType(*reinterpret_cast<const T*> (iData), iIndex, oItemHolder, viewType, context);
00064 }
00065 }
00069 virtual void build(const T& iData, unsigned int iIndex,TEveElement& oItemHolder, const FWViewContext*)
00070 {
00071 throw std::runtime_error("virtual build(const T&, unsigned int, TEveElement&, const FWViewContext*) not implemented by inherited class.");
00072 }
00073
00074 virtual void buildViewType(const T& iData, unsigned int iIndex,TEveElement& oItemHolder, FWViewType::EType viewType, const FWViewContext*)
00075 {
00076 throw std::runtime_error("virtual buildViewType(const T&, unsigned int, TEveElement&, FWViewType::EType, const FWViewContext*) not implemented by inherited class");
00077 };
00078
00079
00080
00081 };
00082
00083
00084 #endif