MCPcopy Create free account
hub / github.com/QuEST-Kit/QuEST / print_table

Function print_table

quest/src/core/printer.cpp:1504–1530  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1502
1503
1504void print_table(string title, vector<tuple<string, string>> rows, string indent) {
1505
1506 // only root node prints
1507 if (!comm_isRootNode())
1508 return;
1509
1510 // find max-width of left column
1511 size_t maxWidth = 0;
1512 for (auto const& [key, value] : rows) {
1513 if (key.length() > maxWidth)
1514 maxWidth = key.length();
1515
1516 // pedantically suppressing unused-variable warning
1517 // (while still mirroring below enumeration for clarity)
1518 (void) value;
1519 }
1520
1521 // print table title (indented)
1522 cout << indent << getTableTitleStr(title) << endl;
1523
1524 // pad left column (which is doubly indented) to align right column
1525 for (auto const& [key, value] : rows)
1526 cout
1527 << indent << indent << left
1528 << setw(maxWidth + MIN_SPACE_BETWEEN_TABLE_COLS) << setfill(TABLE_SPACE_CHAR)
1529 << key << value << endl;
1530}
1531
1532
1533void print_table(string title, vector<tuple<string, long long int>> rows, string indent) {

Callers 12

printPrecisionInfoFunction · 0.85
printCompilationInfoFunction · 0.85
printDeploymentInfoFunction · 0.85
printCpuInfoFunction · 0.85
printGpuInfoFunction · 0.85
printDistributionInfoFunction · 0.85
printQuregSizeLimitsFunction · 0.85
printDeploymentInfoFunction · 0.85
printDimensionInfoFunction · 0.85
printDistributionInfoFunction · 0.85
printMemoryInfoFunction · 0.85

Calls 2

comm_isRootNodeFunction · 0.85
getTableTitleStrFunction · 0.85

Tested by

no test coverage detected