11#ifndef ROOT_RDFDISPLAYER
12#define ROOT_RDFDISPLAYER
88 std::vector<std::vector<DElement_t>>
fTable;
113 template <
typename T,
131 template <
typename T, std::enable_if_t<std::is_arithmetic_v<T>,
int> = 0>
161 template <typename T, std::enable_if_t<ROOT::Internal::RDF::IsDataContainer<T>::value &&
162 !std::is_arithmetic_v<typename T::value_type>,
166 size_t collectionSize = std::distance(std::begin(collection), std::end(collection));
177 for (
size_t i = 0; i < collectionSize; ++i) {
179 <<
") = cling::printValue((" <<
output[1] <<
"*)"
192 template <typename T, std::enable_if_t<ROOT::Internal::RDF::IsDataContainer<T>::value &&
193 std::is_arithmetic_v<typename T::value_type> &&
194 !std::is_same_v<typename T::value_type, bool>,
198 auto collectionSize = std::distance(std::begin(collection), std::end(collection));
199 VecStr_t collectionRepr(collectionSize);
200 std::generate(collectionRepr.begin(), collectionRepr.end(), [i = 0, &collection]()
mutable {
201 auto valRepr = std::to_string(collection[i]);
216 template <typename T, std::enable_if_t<ROOT::Internal::RDF::IsDataContainer<T>::value &&
217 std::is_same_v<typename T::value_type, bool>,
221 auto collectionSize = std::distance(std::begin(collection), std::end(collection));
222 VecStr_t collectionRepr(collectionSize);
223 std::generate(collectionRepr.begin(), collectionRepr.end(), [i = 0, &collection]()
mutable {
224 auto valRepr = (collection[i] ?
"true" :
"false");
245 const auto length = charArr[charArr.
size()-1] ==
'\0' ? charArr.
size() - 1 : charArr.
size();
246 const std::string arrAsStr(charArr.
data(),
length);
253 void AddToRow(
const std::string &stringEle);
278 template <
typename... Columns>
281 std::stringstream calc;
287 const std::string toJit = calc.str();
313 RDisplay(
const VecStr_t &columnNames,
const VecStr_t &types,
size_t nMaxCollectionElements);
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h length
Helper class to let Display print compact tabular representations of the events.
bool IsIgnore() const
Return if the cell has to be skipped.
bool IsDot() const
Return if the cell has to be replaced by "...".
const std::string & GetRepresentation() const
bool IsPrint() const
Return if the cell has to be printed.
void SetDots()
Flag this cell to be replaced by "...".
PrintingAction fPrintingAction
void SetPrint()
Flag this cell as to be printed.
void SetIgnore()
Flag this cell as to be skipped.
std::string fRepresentation
RDisplayElement()
Constructor assuming an empty representation to be printed.
pointer data() noexcept
Return a pointer to the vector's buffer, even if empty().
This class is the textual representation of the content of a columnar dataset.
void AddRow(Columns &... columns)
Adds a row of events to the table.
void AddCollectionToRow(const VecStr_t &collection)
Adds a collection to the table.
size_t fCurrentColumn
Column that is being filled.
bool AddInterpreterString(std::stringstream &, T &collection, const int &index)
Represent a collection of values as a collection of strings.
size_t fNMaxCollectionElements
std::vector< std::vector< DElement_t > > fTable
String representation of the data to be printed.
std::vector< bool > fIsCollection
True if the column contains a collection.
std::string AsStringHtml() const
void AddToRow(const std::string &stringEle)
Adds a single element to the next slot in the table.
size_t fCurrentRow
Row that is being filled.
VecStr_t fRepresentations
Used by the JITted code to store the string representation of the data.
std::string AsStringMarkdown(bool considerDots) const
void MovePosition()
Moves to the next cell.
std::vector< unsigned short > fWidths
Tracks the maximum width of each column, based on the largest element.
bool AddInterpreterString(std::stringstream &stream, T &collection, const int &index)
Appends collection.size() cling::printValue calls to the stringstream.
void Print(const RPrintOptions &options={EPrintFormat::kMarkdown}) const
Prints the representation to the standard output.
static constexpr unsigned fgMaxWidth
Maximum width of the table that Print() displays.
std::string AsString(const RPrintOptions &options={EPrintFormat::kMarkdown}) const
Returns the representation as a string.
bool AddInterpreterString(std::stringstream &, bool &element, const int &index)
Appends a string if the T type is boolean.
void EnsureCurrentColumnWidth(size_t w)
size_t fNextRow
Next row to be filled.
bool AddInterpreterString(std::stringstream &, ROOT::RVec< char > &charArr, const int &index)
AddInterpreterString overload for arrays of chars.
std::string DashesBetweenLines(size_t lastColToPrint, bool allColumnsFit) const
Generate dashes between entries in Print() and AsString() Methods.
std::string AsStringInternal(bool considerDots, const RPrintOptions &options={EPrintFormat::kMarkdown}) const
std::vector< std::string > VecStr_t
std::vector< VecStr_t > fCollectionsRepresentations
Used by the JITted code to store the string representation of the data in case of collection.
size_t GetNColumnsToShorten() const
Get the number of columns that do NOT fit in the characters limit.
static constexpr char fgSeparator
Spacing used to align the table entries.
bool AddInterpreterString(std::stringstream &stream, T &element, const int &index)
Appends a cling::printValue call to the stringstream This overload works for non-collection data type...
bool AddInterpreterString(std::stringstream &, T &element, const int &index)
Appends a string if the T type is an arithmetic type.
VecStr_t fTypes
This attribute stores the type of each column. It is needed by the interpreter to print it.
size_t fNColumns
Number of columns to be printed.
A "std::vector"-like collection of values implementing handy operation to analyse them.
std::string PrettyPrintAddr(const void *const addr)
void InterpreterCalc(const std::string &code, const std::string &context="")
Jit code in the interpreter with TInterpreter::Calc, throw in case of errors.
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
int GetSplit(const char *type, std::vector< std::string > &output, int &nestedLoc, EModType mode=TClassEdit::kNone)
Stores in output (after emptying it) the split type.
Check for container traits.