diff --git a/tree/treeplayer/inc/DataFrameLinkDef.h b/tree/treeplayer/inc/DataFrameLinkDef.h index 84d308f253dfc48cd529f56bd39b17ce35b79f60..360a4e43fd92a5f8e3cb15c73f340ad78e0ebe8e 100644 --- a/tree/treeplayer/inc/DataFrameLinkDef.h +++ b/tree/treeplayer/inc/DataFrameLinkDef.h @@ -9,9 +9,9 @@ #ifdef __ROOTCLING__ // All these are there for the autoloading -#pragma link C++ class ROOT::Experimental::TDataFrame-; -#pragma link C++ class ROOT::Experimental::TDataFrameInterface<ROOT::Detail::TDataFrameFilterBase>-; -#pragma link C++ class ROOT::Experimental::TDataFrameInterface<ROOT::Detail::TDataFrameBranchBase>-; +#pragma link C++ class ROOT::Experimental::TDF::TDataFrame-; +#pragma link C++ class ROOT::Experimental::TDF::TDataFrameInterface<ROOT::Detail::TDataFrameFilterBase>-; +#pragma link C++ class ROOT::Experimental::TDF::TDataFrameInterface<ROOT::Detail::TDataFrameBranchBase>-; #pragma link C++ class ROOT::Detail::TDataFrameImpl-; #endif diff --git a/tree/treeplayer/inc/ROOT/TDataFrame.hxx b/tree/treeplayer/inc/ROOT/TDataFrame.hxx index ca702c8ee40569ffdbf01591246efea4148237fb..b2a466c92971c9925d82296fb7e39f9883bca1fa 100644 --- a/tree/treeplayer/inc/ROOT/TDataFrame.hxx +++ b/tree/treeplayer/inc/ROOT/TDataFrame.hxx @@ -30,13 +30,9 @@ class TTree; R__LOAD_LIBRARY(libTreePlayer) -namespace cling { -// TDataFrame pretty-printing -std::string printValue(ROOT::Experimental::TDataFrame *tdf); -} - namespace ROOT { namespace Experimental { +namespace TDF { class TDataFrame : public TDataFrameInterface<ROOT::Detail::TDataFrameImpl> { public: @@ -50,7 +46,7 @@ public: /// /// The default branches are looked at in case no branch is specified in the /// booking of actions or transformations. - /// See ROOT::Experimental::TDataFrameInterface for the documentation of the + /// See TDataFrameInterface for the documentation of the /// methods available. template < typename FILENAMESCOLL, @@ -74,6 +70,8 @@ TDataFrame::TDataFrame(const std::string &treeName, const FILENAMESCOLL &filenam fProxiedPtr->SetTree(std::make_shared<TTree>(static_cast<TTree *>(chain))); } +} // end NS TDF +using TDF::TDataFrame; // let users access TDataFrame as ROOT::Experimental::TDataFrame } // end NS Experimental } // end NS ROOT diff --git a/tree/treeplayer/inc/ROOT/TDataFrameInterface.hxx b/tree/treeplayer/inc/ROOT/TDataFrameInterface.hxx index f24b8d82713919801d900d994672a62e52c59351..43f53b467173cb4fcd2f097bcd3f8370acdecdb0 100644 --- a/tree/treeplayer/inc/ROOT/TDataFrameInterface.hxx +++ b/tree/treeplayer/inc/ROOT/TDataFrameInterface.hxx @@ -61,13 +61,13 @@ void JitBuildAndBook(const BranchNames_t &bl, const std::string &nodeTypename, v } // namespace Internal namespace Experimental { -using namespace ROOT::Experimental::TDF; //TODO delete line +namespace TDF { // forward declarations class TDataFrame; /** -* \class ROOT::Experimental::TDataFrameInterface +* \class ROOT::Experimental::TDF::TDataFrameInterface * \ingroup dataframe * \brief The public interface to the TDataFrame federation of classes: TDataFrameImpl, TDataFrameFilter, * TDataFrameBranch @@ -76,7 +76,7 @@ class TDataFrame; */ template <typename Proxied> class TDataFrameInterface { - friend std::string cling::printValue(ROOT::Experimental::TDataFrame *tdf); // For a nice printing at the prompt + friend std::string cling::printValue(ROOT::Experimental::TDF::TDataFrame *tdf); // For a nice printing at the prompt TODO try using unqualified TDataFrame name template <typename T> friend class TDataFrameInterface; template <typename TDFNode, typename ActionType, typename... BranchTypes, typename ActionResultType> @@ -1127,31 +1127,32 @@ protected: template <> inline const char *TDataFrameInterface<ROOT::Detail::TDataFrameFilterBase>::GetNodeTypeName() { - return "ROOT::Experimental::TDataFrameInterface<ROOT::Detail::TDataFrameFilterBase>"; + return "ROOT::Experimental::TDF::TDataFrameInterface<ROOT::Detail::TDataFrameFilterBase>"; } template <> inline const char *TDataFrameInterface<ROOT::Detail::TDataFrameBranchBase>::GetNodeTypeName() { - return "ROOT::Experimental::TDataFrameInterface<ROOT::Detail::TDataFrameBranchBase>"; + return "ROOT::Experimental::TDF::TDataFrameInterface<ROOT::Detail::TDataFrameBranchBase>"; } template <> inline const char *TDataFrameInterface<ROOT::Detail::TDataFrameImpl>::GetNodeTypeName() { - return "ROOT::Experimental::TDataFrameInterface<ROOT::Detail::TDataFrameImpl>"; + return "ROOT::Experimental::TDF::TDataFrameInterface<ROOT::Detail::TDataFrameImpl>"; } template <> inline const char *TDataFrameInterface<ROOT::Detail::TDataFrameRangeBase>::GetNodeTypeName() { - return "ROOT::Experimental::TDataFrameInterface<ROOT::Detail::TDataFrameRangeBase>"; + return "ROOT::Experimental::TDF::TDataFrameInterface<ROOT::Detail::TDataFrameRangeBase>"; } // Before we had to specialise the GetNodeTypeName method // extern template class TDataFrameInterface<ROOT::Detail::TDataFrameFilterBase>; // extern template class TDataFrameInterface<ROOT::Detail::TDataFrameBranchBase>; +} // end NS TDF } // end NS Experimental } // end NS ROOT diff --git a/tree/treeplayer/src/TDataFrame.cxx b/tree/treeplayer/src/TDataFrame.cxx index f8ff0c03d68e403e79ba6f056aac60bf776c5027..e2a5d446276221b0cdcc606e01605c1ab0fb9372 100644 --- a/tree/treeplayer/src/TDataFrame.cxx +++ b/tree/treeplayer/src/TDataFrame.cxx @@ -9,9 +9,7 @@ *************************************************************************/ #include "ROOT/TDataFrame.hxx" - -namespace ROOT { -namespace Experimental { +using namespace ROOT::Experimental::TDF; /** * \class ROOT::Experimental::TDataFrame @@ -502,7 +500,7 @@ thread-safety, see [here](#generic-actions). /// /// The default branches are looked at in case no branch is specified in the /// booking of actions or transformations. -/// See ROOT::Experimental::TDataFrameInterface for the documentation of the +/// See TDataFrameInterface for the documentation of the /// methods available. TDataFrame::TDataFrame(const std::string &treeName, TDirectory *dirPtr, const BranchNames_t &defaultBranches) : TDataFrameInterface<ROOT::Detail::TDataFrameImpl>( @@ -528,7 +526,7 @@ TDataFrame::TDataFrame(const std::string &treeName, TDirectory *dirPtr, const Br /// /// The default branches are looked at in case no branch is specified in the /// booking of actions or transformations. -/// See ROOT::Experimental::TDataFrameInterface for the documentation of the +/// See TDataFrameInterface for the documentation of the /// methods available. TDataFrame::TDataFrame(const std::string &treeName, const std::string &filenameglob, const BranchNames_t &defaultBranches) @@ -547,7 +545,7 @@ TDataFrame::TDataFrame(const std::string &treeName, const std::string &filenameg /// /// The default branches are looked at in case no branch is specified in the /// booking of actions or transformations. -/// See ROOT::Experimental::TDataFrameInterface for the documentation of the +/// See TDataFrameInterface for the documentation of the /// methods available. TDataFrame::TDataFrame(TTree &tree, const BranchNames_t &defaultBranches) : TDataFrameInterface<ROOT::Detail::TDataFrameImpl>( @@ -567,7 +565,3 @@ TDataFrame::TDataFrame(Long64_t numEntries) std::make_shared<ROOT::Detail::TDataFrameImpl>(numEntries)) { } - -} // end NS Experimental - -} // end NS ROOT diff --git a/tree/treeplayer/src/TDataFrameInterface.cxx b/tree/treeplayer/src/TDataFrameInterface.cxx index f1733e5efca1bfb42a14c0d7dac18d1f83a11406..3f0c775c88c5f305696b7a3592d28978490b0c7f 100644 --- a/tree/treeplayer/src/TDataFrameInterface.cxx +++ b/tree/treeplayer/src/TDataFrameInterface.cxx @@ -15,9 +15,14 @@ #include <vector> #include <string> +using namespace ROOT::Experimental::TDF; -namespace ROOT { +// extern templates +template class TDataFrameInterface<ROOT::Detail::TDataFrameImpl>; +template class TDataFrameInterface<ROOT::Detail::TDataFrameFilterBase>; +template class TDataFrameInterface<ROOT::Detail::TDataFrameBranchBase>; +namespace ROOT { namespace Internal { // Match expression against names of branches passed as parameter // Return vector of names of the branches used in the expression @@ -217,12 +222,4 @@ void JitBuildAndBook(const BranchNames_t &bl, const std::string &nodeTypename, v } } // namespace Internal -namespace Experimental { - -// extern templates -template class TDataFrameInterface<ROOT::Detail::TDataFrameImpl>; -template class TDataFrameInterface<ROOT::Detail::TDataFrameFilterBase>; -template class TDataFrameInterface<ROOT::Detail::TDataFrameBranchBase>; - -} // namespace Experimental } // namespace ROOT