12 #ifndef ROOT7_REveTableInfo
13 #define ROOT7_REveTableInfo
19 namespace Experimental {
25 class REveTableEntry {
29 std::string fExpression;
30 REveDataColumn::FieldType_e fType;
32 REveTableEntry() : fName(
"unknown"), fPrecision(2), fType(REveDataColumn::FT_Double) {}
34 REveTableEntry(
const std::string &name,
int precision,
const std::string &expression)
35 : fName(name), fPrecision(precision), fExpression(expression), fType(REveDataColumn::FT_Double)
41 printf(
"TableEntry\n");
42 printf(
"name: %s expression: %s\n", fName.c_str(), fExpression.c_str());
52 friend class REveTableViewInfo;
55 typedef std::vector<REveTableEntry> Entries_t;
56 typedef std::map<std::string, Entries_t> Specs_t;
61 column(
const std::string &name,
int precision,
const std::string &expression)
63 fSpecs[fClassName].emplace_back(name, precision, expression);
67 REveTableHandle &column(
const std::string &label,
int precision)
69 return column(label, precision, label);
72 REveTableHandle(std::string className, Specs_t &specs)
73 :fClassName(className), fSpecs(specs)
78 std::string fClassName;
86 class REveTableViewInfo :
public REveElement
89 REveTableViewInfo(
const std::string &name =
"TableViewManager",
const std::string &title =
"");
91 typedef std::function<void ()> Delegate_t;
93 void SetDisplayedCollection(ElementId_t);
94 ElementId_t GetDisplayedCollection()
const {
return fDisplayedCollection; }
96 void AddNewColumnToCurrentCollection(
const std::string& expr,
const std::string& title,
int prec = 2);
98 void AddDelegate(Delegate_t d) { fDelegates.push_back(d); }
100 Int_t WriteCoreJson(nlohmann::json &j, Int_t rnr_offset)
override;
103 REveTableHandle::Entries_t &RefTableEntries(std::string cname) {
return fSpecs[cname]; }
106 REveTableHandle table(std::string className)
108 REveTableHandle handle(className, fSpecs);
112 bool GetConfigChanged()
const {
return fConfigChanged; }
116 int fDisplayedCollection{0};
117 std::vector<Delegate_t> fDelegates;
118 REveTableHandle::Specs_t fSpecs;
119 bool fConfigChanged{
false};