ROOT 6.18/05 Reference Guide |
This class is the textual representation of the content of a columnar dataset.
This class is provided to the user, and it can be used to print on screen the entries of the dataset requested through the Display action in a compact representation or to return the full representation of the events as a string. In order to apply proper formatting the content is buffered in memory as strings.
Definition at line 64 of file RDisplay.hxx.
Public Member Functions | |
RDisplay (const VecStr_t &columnNames, const VecStr_t &types, int entries) | |
Creates an RDisplay to print the event values. More... | |
std::string | AsString () const |
Returns the representation as a string. More... | |
void | Print () const |
Prints the representation to the standard output. More... | |
Private Types | |
using | DElement_t = ROOT::Internal::RDF::RDisplayElement |
using | VecStr_t = std::vector< std::string > |
Private Member Functions | |
void | AddCollectionToRow (const VecStr_t &collection) |
Adds a collection to the table. More... | |
template<typename T , typename std::enable_if< ROOT::TypeTraits::IsContainer< T >::value, int >::type = 0> | |
bool | AddInterpreterString (std::stringstream &stream, T &collection, const int &index) |
Appends collection.size() cling::printValue call to the stringstream. More... | |
template<typename T , typename std::enable_if<!ROOT::TypeTraits::IsContainer< T >::value, int >::type = 0> | |
bool | AddInterpreterString (std::stringstream &stream, T &element, const int &index) |
Appends a cling::printValue call to the stringstream. More... | |
template<typename... Columns> | |
void | AddRow (Columns... columns) |
Adds a row of events to the table. More... | |
void | AddToRow (const std::string &stringEle) |
Adds a single element to the next slot in the table. More... | |
size_t | GetNColumnsToShorten () const |
Get the number of columns that do NOT fit in the characters limit. More... | |
bool | HasNext () |
If the number of required rows has been parsed, returns false. More... | |
void | MovePosition () |
Moves to the next cell. More... | |
Private Attributes | |
std::vector< VecStr_t > | fCollectionsRepresentations |
Used by the JITted code to store the string representation of the data in case of collection. More... | |
size_t | fCurrentColumn = 0 |
Column that is being filled. More... | |
size_t | fCurrentRow = 0 |
Row that is being filled. More... | |
size_t | fEntries |
Number of events to process for each column (i.e. number of rows). More... | |
std::vector< bool > | fIsCollection |
True if the column contains a collection. More... | |
size_t | fNColumns |
Number of columns to be printed. More... | |
size_t | fNextRow = 1 |
Next row to be filled. More... | |
VecStr_t | fRepresentations |
Used by the JITted code to store the string representation of the data. More... | |
std::vector< std::vector< DElement_t > > | fTable |
String representation of the data to be printed. More... | |
VecStr_t | fTypes |
This attribute stores the type of each column. It is needed by the interpreter to print it. More... | |
std::vector< unsigned short > | fWidths |
Tracks the maximum width of each column, based on the largest element. More... | |
Static Private Attributes | |
static constexpr unsigned | fgMaxWidth = 80 |
static constexpr char | fgSeparator = ' ' |
Spacing used to align the table entries. More... | |
Friends | |
template<typename T > | |
class | ROOT::Internal::RDF::DisplayHelper |
#include <ROOT/RDF/RDisplay.hxx>
|
private |
Definition at line 69 of file RDisplay.hxx.
|
private |
Definition at line 68 of file RDisplay.hxx.
Creates an RDisplay to print the event values.
[in] | columnNames | Columns to print |
[in] | types | The type of each column |
[in] | entries | How many events per column (row) must be processed. |
Definition at line 159 of file RDFDisplay.cxx.
Adds a collection to the table.
Starting from the slot, the elements are added one under the other, each one using a single cell of an entire row
Definition at line 105 of file RDFDisplay.cxx.
|
inlineprivate |
Appends collection.size() cling::printValue call to the stringstream.
T | the type of the event to convert |
[in] | stream | Where the conversion function call will be chained. |
[in] | element | The event to convert to its string representation |
[in] | index | To which column the event belongs to |
Definition at line 116 of file RDisplay.hxx.
|
inlineprivate |
Appends a cling::printValue call to the stringstream.
T | the type of the event to convert |
[in] | stream | Where the conversion function call will be chained. |
[in] | element | The event to convert to its string representation |
[in] | index | To which column the event belongs to |
Definition at line 100 of file RDisplay.hxx.
|
inlineprivate |
Adds a row of events to the table.
Definition at line 160 of file RDisplay.hxx.
|
private |
Adds a single element to the next slot in the table.
Definition at line 92 of file RDFDisplay.cxx.
std::string ROOT::RDF::RDisplay::AsString | ( | ) | const |
Returns the representation as a string.
Definition at line 239 of file RDFDisplay.cxx.
|
private |
Get the number of columns that do NOT fit in the characters limit.
Definition at line 171 of file RDFDisplay.cxx.
|
inlineprivate |
If the number of required rows has been parsed, returns false.
Definition at line 184 of file RDisplay.hxx.
|
private |
Moves to the next cell.
Moves to the next cell, and if the row is full moves to the next row.
Definition at line 147 of file RDFDisplay.cxx.
Prints the representation to the standard output.
Collections are shortened to the first and last element. The overall width is shortened to a fixed size of TODO
Definition at line 186 of file RDFDisplay.cxx.
|
friend |
Definition at line 66 of file RDisplay.hxx.
|
private |
Used by the JITted code to store the string representation of the data in case of collection.
Each row corresponds to a column, each column to a value of the collection.
Definition at line 80 of file RDisplay.hxx.
|
private |
Column that is being filled.
Definition at line 88 of file RDisplay.hxx.
|
private |
Row that is being filled.
Definition at line 86 of file RDisplay.hxx.
|
private |
Number of events to process for each column (i.e. number of rows).
Definition at line 90 of file RDisplay.hxx.
|
staticconstexprprivate |
Definition at line 71 of file RDisplay.hxx.
|
staticconstexprprivate |
Spacing used to align the table entries.
Definition at line 70 of file RDisplay.hxx.
|
private |
True if the column contains a collection.
Collections are treated differently during the printing.
Definition at line 74 of file RDisplay.hxx.
|
private |
Number of columns to be printed.
Definition at line 84 of file RDisplay.hxx.
|
private |
Next row to be filled.
Definition at line 87 of file RDisplay.hxx.
|
private |
Used by the JITted code to store the string representation of the data.
Definition at line 79 of file RDisplay.hxx.
|
private |
String representation of the data to be printed.
Definition at line 76 of file RDisplay.hxx.
|
private |
This attribute stores the type of each column. It is needed by the interpreter to print it.
Definition at line 73 of file RDisplay.hxx.
|
private |
Tracks the maximum width of each column, based on the largest element.
Definition at line 77 of file RDisplay.hxx.