25#include <nlohmann/json.hpp>
30 struct TableDictHelper {
33 static size_t maxEnt = 3;
35 TIter next(
c->GetListOfAllPublicMethods());
36 while ((meth = (TMethod *)next()) && entries.size() < maxEnt) {
39 std::string mn = meth->
GetName();
40 std::string
exp =
"i." + mn +
"()";
48 entries.push_back(REveTableEntry(mn, 0, exp));
50 entries.push_back(REveTableEntry(mn, 3, exp));
57 TIter blnext(
c->GetListOfBases());
58 while ((base = (TBaseClass *)blnext())) {
66 TIter blnext(
c->GetListOfBases());
67 while ((base = (TBaseClass *)blnext())) {
68 auto bs = specs.find(base->
GetName());
69 if (bs != specs.end()) {
99 static const REveException eh(
"REveTableViewInfo::AddNewColumnToCurrentCollection");
106 printf(
"REveTableViewInfo::AddNewColumnToCurrentCollection error: collection not found\n");
111 throw eh +
"column-expression verification failed.";
114 const char *rtyp =
"void";
116 std::function<void(
void *)> fooptr;
118 s <<
"*((std::function<" << rtyp <<
"(" << icls->GetName() <<
"*)>*)" << std::hex << std::showbase
119 << (size_t)(&fooptr) <<
") = [](" << icls->GetName() <<
"* p){" << icls->GetName()
120 <<
" &i=*p; return (" << expr <<
"); }";
125 gROOT->ProcessLine(s.str().c_str(), &
err);
127 throw eh +
"column expression compilation check failed.";
132 auto sit =
fSpecs.find(icls->GetName());
133 if (sit !=
fSpecs.end()) {
136 TableDictHelper helper;
138 std::string
n =
b->GetName();
139 for (REveTableHandle::Entries_t::iterator
e =
fSpecs[
n].begin();
e !=
fSpecs[
n].end(); ++
e) {
157 TableDictHelper helper;
158 auto search =
fSpecs.find(cname);
159 if (search !=
fSpecs.end()) {
160 return search->second;
int Int_t
Signed integer 4 bytes (int).
TClass * GetItemClass() const
virtual Int_t WriteCoreJson(nlohmann::json &cj, Int_t rnr_offset)
Write core json.
REveElement(const std::string &name="", const std::string &title="")
Default constructor.
REveException Exception-type thrown by Eve classes.
std::map< std::string, Entries_t > Specs_t
REveTableHandle & column(const std::string &name, int precision, const std::string &expression)
std::vector< REveTableEntry > Entries_t
REveTableViewInfo(const std::string &name="TableViewManager", const std::string &title="")
void SetDisplayedCollection(ElementId_t)
std::vector< Delegate_t > fDelegates
REveTableHandle::Specs_t fSpecs
REveTableHandle::Entries_t & RefTableEntries(std::string cname)
Find column definitions for given class name.
REveTableHandle table(std::string className)
void AddNewColumnToCurrentCollection(const char *expr, const char *title, int prec=2)
Int_t WriteCoreJson(nlohmann::json &j, Int_t rnr_offset) override
Fill core part of JSON representation.
static bool VerifyObjectFilterOrTableExpression(std::string_view expr)
Input string verification and sanitization.
TClass * GetClassPointer(Bool_t load=kTRUE)
Get pointer to the base class TClass.
TClass instances represent classes, structs and namespaces in the ROOT type system.
static TClass * GetClass(const char *name, Bool_t load=kTRUE, Bool_t silent=kFALSE)
Static method returning pointer to TClass of the specified class name.
const char * GetReturnTypeName() const
Get full type description of function return type, e,g.: "class TDirectory*".
TObject * First() const override
Return the first object in the list. Returns 0 when list is empty.
virtual TList * GetListOfMethodArgs()
Returns methodarg list and additionally updates fDataMember in TMethod by calling FindDataMember();.
const char * GetName() const override
Returns name of object.
RVec< PromoteType< T > > exp(const RVec< T > &v)
Namespace for ROOT features in testing.