Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:10:39

0001 // @(#)root/eve7:$Id$
0002 // Authors: Matevz Tadel & Alja Mrak-Tadel: 2020
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2020, Rene Brun and Fons Rademakers.               *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010  *************************************************************************/
0011 
0012 #ifndef ROOT7_REveDataProxySimpleBuilderTemplate
0013 #define ROOT7_REveDataProxySimpleBuilderTemplate
0014 
0015 #include <ROOT/REveDataSimpleProxyBuilder.hxx>
0016 
0017 
0018 namespace ROOT {
0019 namespace Experimental {
0020 
0021 template <typename T>
0022 class REveDataSimpleProxyBuilderTemplate : public REveDataSimpleProxyBuilder {
0023 
0024 public:
0025    REveDataSimpleProxyBuilderTemplate() : REveDataSimpleProxyBuilder()
0026    {
0027    }
0028 
0029 protected:
0030    using REveDataSimpleProxyBuilder::BuildItem;
0031    void BuildItem(const void *iData, int index, REveElement *itemHolder, const REveViewContext *context) override
0032    {
0033       if(iData) {
0034          BuildItem(*reinterpret_cast<const T*> (iData), index, itemHolder, context);
0035       }
0036    }
0037 
0038    virtual void BuildItem(const T & /*iData*/, int /*index*/, REveElement * /*itemHolder*/, const REveViewContext * /*context*/)
0039    {
0040       throw std::runtime_error("virtual Build(const T&, int, REveElement&, const REveViewContext*) not implemented by inherited class.");
0041    }
0042 
0043    using REveDataSimpleProxyBuilder::BuildItemViewType;
0044    void BuildItemViewType(const void *iData, int index, REveElement *itemHolder, const std::string& viewType, const REveViewContext *context) override
0045    {
0046       if(iData) {
0047          BuildItemViewType(*reinterpret_cast<const T*> (iData), index, itemHolder, viewType, context);
0048       }
0049    }
0050 
0051    virtual void BuildItemViewType(const T & /*iData*/, int /*index*/, REveElement * /*itemHolder*/, const std::string& /*viewType*/, const REveViewContext * /*context*/)
0052    {
0053       throw std::runtime_error("virtual BuildViewType(const T&, int, REveElement&, const REveViewContext*) not implemented by inherited class.");
0054    }
0055 
0056 private:
0057    REveDataSimpleProxyBuilderTemplate(const REveDataSimpleProxyBuilderTemplate&) = delete; // stop default
0058 
0059    const REveDataSimpleProxyBuilderTemplate& operator=(const REveDataSimpleProxyBuilderTemplate&) = delete; // stop default
0060 };
0061 
0062 } // namespace Experimental
0063 } // namespace ROOT
0064 
0065 #endif