Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[TDF] clang-format
  • Loading branch information
eguiraud committed Mar 19, 2017
commit c1935531fa8e22d716300d72368cc3ab5040ee60
23 changes: 12 additions & 11 deletions tree/treeplayer/inc/ROOT/TDFNodes.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ class TDataFrameImpl : public std::enable_shared_from_this<TDataFrameImpl> {
};

ROOT::Detail::ActionBaseVec_t fBookedActions;
ROOT::Detail::FilterBaseVec_t fBookedFilters;
ROOT::Detail::FilterBaseVec_t fBookedNamedFilters;
ROOT::Detail::FilterBaseVec_t fBookedFilters;
ROOT::Detail::FilterBaseVec_t fBookedNamedFilters;
std::map<std::string, TmpBranchBasePtr_t> fBookedBranches;
std::vector<std::shared_ptr<bool>> fResProxyReadiness;
::TDirectory * fDirPtr{nullptr};
Expand All @@ -82,7 +82,7 @@ public:
const BranchNames_t GetTmpBranches() const { return {}; };
TTree * GetTree() const;
TDataFrameBranchBase *GetBookedBranch(const std::string &name) const;
const std::map<std::string, TmpBranchBasePtr_t>& GetBookedBranches() const { return fBookedBranches; }
const std::map<std::string, TmpBranchBasePtr_t> &GetBookedBranches() const { return fBookedBranches; }
void *GetTmpBranchValue(const std::string &branch, unsigned int slot);
::TDirectory *GetDirectory() const;
std::string GetTreeName() const;
Expand All @@ -92,8 +92,8 @@ public:
void Book(const std::shared_ptr<bool> &branchPtr);
bool CheckFilters(int, unsigned int);
unsigned int GetNSlots() const;
bool HasRunAtLeastOnce() const { return fHasRunAtLeastOnce; }
void Report() const;
bool HasRunAtLeastOnce() const { return fHasRunAtLeastOnce; }
void Report() const;
/// End of recursive chain of calls, does nothing
void PartialReport() const {}
void SetTree(TTree *tree) { fTree = tree; }
Expand Down Expand Up @@ -134,7 +134,7 @@ class TDataFrameValue {
std::unique_ptr<TTreeReaderArray<ProxyParam_t>> fReaderArray{nullptr}; //< Owning ptr to a TTreeReaderArray. Used for
/// non-temporary columsn and
/// T == std::array_view<U>.
T *fValuePtr{nullptr}; //< Non-owning ptr to the value of a temporary column.
T * fValuePtr{nullptr}; //< Non-owning ptr to the value of a temporary column.
ROOT::Detail::TDataFrameBranchBase *fTmpColumn{
nullptr}; //< Non-owning ptr to the node responsible for the temporary column.
unsigned int fSlot = 0; //< The slot this value belongs to. Only used for temporary columns, not for real branches.
Expand All @@ -158,8 +158,9 @@ public:
int>::type = 0>
T &Get(Long64_t entry);

template<typename U = T, typename std::enable_if<!std::is_same<ProxyParam_t, U>::value, int>::type = 0>
std::array_view<ProxyParam_t> Get(Long64_t entry) {
template <typename U = T, typename std::enable_if<!std::is_same<ProxyParam_t, U>::value, int>::type = 0>
std::array_view<ProxyParam_t> Get(Long64_t entry)
{
auto &readerArray = *fReaderArray;
if (readerArray.GetSize() > 1 && 1 != (&readerArray[1] - &readerArray[0])) {
std::string exceptionText = "Branch ";
Expand Down Expand Up @@ -369,9 +370,9 @@ class TDataFrameFilter final : public TDataFrameFilterBase {
using BranchTypes_t = typename ROOT::Internal::TDFTraitsUtils::TFunctionTraits<FilterF>::Args_t;
using TypeInd_t = typename ROOT::Internal::TDFTraitsUtils::TGenStaticSeq<BranchTypes_t::fgSize>::Type_t;

FilterF fFilter;
const BranchNames_t fBranches;
PrevDataFrame & fPrevData;
FilterF fFilter;
const BranchNames_t fBranches;
PrevDataFrame & fPrevData;
std::vector<ROOT::Internal::TDFValueTuple_t<BranchTypes_t>> fValues;

public:
Expand Down
16 changes: 8 additions & 8 deletions tree/treeplayer/inc/ROOT/TDFUtils.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -145,17 +145,17 @@ struct TIsContainer {
};

// Extract first of possibly many template parameters. For non-template types, the result is the type itself
template<typename T>
template <typename T>
struct TExtractType {
using type = T;
};

template<typename T, template<typename...> class U, typename...Extras>
template <typename T, template <typename...> class U, typename... Extras>
struct TExtractType<U<T, Extras...>> {
using type = T;
};

template<typename T>
template <typename T>
using ExtractType_t = typename TExtractType<T>::type;

} // end NS TDFTraitsUtils
Expand Down Expand Up @@ -199,16 +199,16 @@ void InitTDFValues(unsigned int slot, TDFValueTuple &valueTuple, TTreeReader &r,
// branch is a temporary branch created with AddColumn, false if they are
// actual branches present in the TTree.
std::array<bool, sizeof...(S)> isTmpColumn;
for (auto i = 0u; i < isTmpColumn.size(); ++i)
for (auto i = 0u; i < isTmpColumn.size(); ++i)
isTmpColumn[i] = std::find(tmpbn.begin(), tmpbn.end(), bn.at(i)) != tmpbn.end();

// hack to expand a parameter pack without c++17 fold expressions.
// auto defines a variable with type std::initializer_list<int>, containing all zeroes, and SetTmpColumn or
// SetProxy are conditionally executed as the braced init list is expanded. The final ... expands S and BranchTypes.
std::initializer_list<int> expander{
(isTmpColumn[S] ? std::get<S>(valueTuple).SetTmpColumn(slot, tmpBranches.at(bn.at(S)).get())
: std::get<S>(valueTuple).MakeProxy(r, bn.at(S)),
0)...};
std::initializer_list<int> expander{(isTmpColumn[S]
? std::get<S>(valueTuple).SetTmpColumn(slot, tmpBranches.at(bn.at(S)).get())
: std::get<S>(valueTuple).MakeProxy(r, bn.at(S)),
0)...};
(void)expander; // avoid "unused variable" warnings for expander on gcc4.9
(void)slot; // avoid _bogus_ "unused variable" warnings for slot on gcc 4.9
}
Expand Down