Logo ROOT  
Reference Guide
REveDataTable.hxx
Go to the documentation of this file.
1 // @(#)root/eve7:$Id$
2 // Authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007, 2018
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2019, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 
13 #ifndef ROOT7_REveDataTable
14 #define ROOT7_REveDataTable
15 
16 #include <ROOT/REveElement.hxx>
17 
18 namespace ROOT {
19 namespace Experimental {
20 
21 class REveDataCollection;
22 
23 class REveDataTable : public REveElement
24 {
25 protected:
27 
28 public:
29  REveDataTable(const std::string& n = "REveDataTable", const std::string& t = "");
30  virtual ~REveDataTable() {}
31 
32  void SetCollection(const REveDataCollection *col) { fCollection = col; }
33  const REveDataCollection *GetCollection() const { return fCollection; }
34 
35  void PrintTable();
36  virtual Int_t WriteCoreJson(nlohmann::json &cj, Int_t rnr_offset);
37 
38  void AddNewColumn(const std::string& expr, const std::string& title, int prec = 2);
39 };
40 
41 //==============================================================================
42 
44 {
45 public:
47 
48 protected:
49 public:
51  FieldType_e fType; // can we auto detect this?
53 
54  std::string fTrue{"*"};
55  std::string fFalse{" "};
56 
59  std::function<std::string(void *)> fStringFoo;
60 
61 public:
62  REveDataColumn(const std::string& n = "REveDataColumn", const std::string& t = "");
63  virtual ~REveDataColumn() {}
64 
65  void SetExpressionAndType(const std::string &expr, FieldType_e type);
66  void SetExpressionAndType(const std::string &expr, FieldType_e type, TClass* c);
67  void SetPrecision(Int_t prec);
68 
69  std::string EvalExpr(void *iptr) const;
70 };
71 
72 
73 } // namespace Experimental
74 } // namespace ROOT
75 #endif
c
#define c(i)
Definition: RSha256.hxx:101
n
const Int_t n
Definition: legend1.C:16
ROOT::Experimental::REveDataCollection
Definition: REveDataCollection.hxx:109
ROOT::Experimental::REveDataColumn::fDoubleFoo
std::function< double(void *)> fDoubleFoo
Definition: REveDataTable.hxx:57
ROOT::Experimental::REveDataTable::GetCollection
const REveDataCollection * GetCollection() const
Definition: REveDataTable.hxx:33
ROOT::Experimental::REveDataColumn::SetPrecision
void SetPrecision(Int_t prec)
Definition: REveDataTable.cxx:134
ROOT::Experimental::REveDataColumn::fType
FieldType_e fType
Definition: REveDataTable.hxx:51
ROOT::Experimental::REveDataColumn::fPrecision
Int_t fPrecision
Definition: REveDataTable.hxx:52
Int_t
int Int_t
Definition: RtypesCore.h:45
ROOT::Experimental::REveDataColumn
Definition: REveDataTable.hxx:44
TString
Basic string class.
Definition: TString.h:136
ROOT::Experimental::REveElement
Definition: REveElement.hxx:41
ROOT::Experimental::REveDataTable::AddNewColumn
void AddNewColumn(const std::string &expr, const std::string &title, int prec=2)
Definition: REveDataTable.cxx:73
ROOT::Experimental::REveDataColumn::FieldType_e
FieldType_e
Definition: REveDataTable.hxx:46
bool
ROOT::Experimental::REveDataTable::fCollection
const REveDataCollection * fCollection
Definition: REveDataTable.hxx:26
ROOT::Experimental::REveDataTable::SetCollection
void SetCollection(const REveDataCollection *col)
Definition: REveDataTable.hxx:32
ROOT::Experimental::REveDataTable::REveDataTable
REveDataTable(const std::string &n="REveDataTable", const std::string &t="")
Definition: REveDataTable.cxx:24
ROOT::Experimental::REveDataColumn::fExpression
TString fExpression
Definition: REveDataTable.hxx:50
ROOT::Experimental::REveDataColumn::FT_String
@ FT_String
Definition: REveDataTable.hxx:46
ROOT::Experimental::REveDataTable::PrintTable
void PrintTable()
Definition: REveDataTable.cxx:30
REveElement.hxx
ROOT::R::function
void function(const Char_t *name_, T fun, const Char_t *docstring=0)
Definition: RExports.h:151
ROOT::Experimental::REveDataColumn::fFalse
std::string fFalse
Definition: REveDataTable.hxx:55
double
double
Definition: Converters.cxx:921
ROOT::Experimental::REveDataColumn::fStringFoo
std::function< std::string(void *)> fStringFoo
Definition: REveDataTable.hxx:59
ROOT::Experimental::REveDataColumn::fBoolFoo
std::function< bool(void *)> fBoolFoo
Definition: REveDataTable.hxx:58
ROOT::Experimental::REveDataTable::~REveDataTable
virtual ~REveDataTable()
Definition: REveDataTable.hxx:30
ROOT::Experimental::REveDataColumn::REveDataColumn
REveDataColumn(const std::string &n="REveDataColumn", const std::string &t="")
Definition: REveDataTable.cxx:88
ROOT::Experimental::REveDataColumn::FT_Bool
@ FT_Bool
Definition: REveDataTable.hxx:46
ROOT::Experimental::REveDataTable::WriteCoreJson
virtual Int_t WriteCoreJson(nlohmann::json &cj, Int_t rnr_offset)
Write core json.
Definition: REveDataTable.cxx:51
TClass
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition: TClass.h:80
ROOT::Experimental::REveDataTable
Definition: REveDataTable.hxx:24
type
int type
Definition: TGX11.cxx:121
ROOT::Experimental::REveDataColumn::SetExpressionAndType
void SetExpressionAndType(const std::string &expr, FieldType_e type)
Definition: REveDataTable.cxx:126
ROOT::Experimental::REveDataColumn::fTrue
std::string fTrue
Definition: REveDataTable.hxx:54
ROOT::Experimental::REveDataColumn::~REveDataColumn
virtual ~REveDataColumn()
Definition: REveDataTable.hxx:63
ROOT
VSD Structures.
Definition: StringConv.hxx:21
ROOT::Experimental::REveDataColumn::FT_Double
@ FT_Double
Definition: REveDataTable.hxx:46
int
ROOT::Experimental::REveDataColumn::EvalExpr
std::string EvalExpr(void *iptr) const
Definition: REveDataTable.cxx:139