Logo ROOT  
Reference Guide
REveTableProxyBuilder.cxx
Go to the documentation of this file.
1#include "TClass.h"
7
8using namespace ROOT::Experimental;
9
10REveTableProxyBuilder::REveTableProxyBuilder() : REveDataProxyBuilderBase("Table"), fTable(nullptr)
11{
12 fTable = new REveDataTable("ProxyTable");
13}
14
16{
17 fTable->Destroy();
18 fTable = nullptr;
19}
20
21// reuse table product
23{
24}
25
26void REveTableProxyBuilder::Build(const REveDataCollection* collection, REveElement* product, const REveViewContext* context)
27{
28 REveTableViewInfo* info = context->GetTableViewInfo();
29 if (info->GetDisplayedCollection() != Collection()->GetElementId())
30 {
31 return;
32 }
33
34 if (product->NumChildren() == 0) {
35 product->AddElement(fTable);
36 }
37
38 // printf("-----REveTableProxyBuilder::Build() body for %s (%p, %p)\n",collection->GetCName(), collection, Collection() );
39
40 if (info->GetConfigChanged() || fTable->NumChildren() == 0) {
42 auto tableEntries = context->GetTableViewInfo()->RefTableEntries(collection->GetItemClass()->GetName());
43 for (const REveTableEntry& spec : tableEntries) {
44 auto c = new REveDataColumn(spec.fName.c_str());
46 using namespace std::string_literals;
47 std::string exp = spec.fExpression;
48 c->SetExpressionAndType(exp.c_str(), spec.fType);
49 c->SetPrecision(spec.fPrecision);
50 }
51 }
53}
54
55
56
58{
60 fTable->SetCollection(collection);
61}
62
64{
65 // printf("REveTableProxyBuilder::ModelChanges\n");
67}
68
70 Build();
71}
#define c(i)
Definition: RSha256.hxx:101
double exp(double)
virtual void SetCollection(REveDataCollection *)
void SetCollection(const REveDataCollection *col)
virtual void Destroy()
Destroy this element.
virtual void AddElement(REveElement *el)
Add el to the list of children.
virtual void DestroyElements()
Destroy all children of this element.
void SetCollection(REveDataCollection *) override
virtual void ModelChanges(const REveDataCollection::Ids_t &, REveDataProxyBuilderBase::Product *p) override
REveTableHandle::Entries_t & RefTableEntries(std::string cname)
ElementId_t GetDisplayedCollection() const
REveTableViewInfo * GetTableViewInfo() const
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:47