GEOS
Classes | Public Types | Public Member Functions | List of all members
geos::TableTextMpiOutput Class Reference

class to format data in a formatted text format, allowing contributions from multiple MPI ranks. More...

#include <TableMpiComponents.hpp>

Inheritance diagram for geos::TableTextMpiOutput:
Inheritance graph
[legend]

Public Types

using Base = TableTextFormatter
 base class
 
- Public Types inherited from geos::TableFormatter
using RowsCellInput = stdVector< stdVector< TableData::CellData > >
 Represent the TableData values.
 
using CellLayoutRows = stdVector< CellLayoutRow >
 Represent a table section (title + header or values) layout: view on the data and its layout settings.
 

Public Member Functions

 TableTextMpiOutput (TableMpiLayout mpiLayout=TableMpiLayout())
 Construct a default Table Formatter without layout specification (to only insert data in it, without any column / title). Feature is not tested. More...
 
 TableTextMpiOutput (TableLayout const &tableLayout, TableMpiLayout mpiLayout=TableMpiLayout())
 Construct a new TableTextMpiOutput from a tableLayout. More...
 
template<typename DATASOURCE >
void toStream (std::ostream &outputStream, DATASOURCE const &tableData) const
 Convert a data source to a table string. More...
 
- Public Member Functions inherited from geos::TableTextFormatter
 TableTextFormatter ()
 Construct a default Table Formatter without layout specification (to only insert data in it, without any column / title). Feature is not tested.
 
 TableTextFormatter (TableLayout const &tableLayout)
 Construct a new TableFormatter from a tableLayout. More...
 
string toString () const
 
template<typename DATASOURCE >
string toString (DATASOURCE const &tableData) const
 Convert a data source to a table string. More...
 
void toStream (std::ostream &outputStream) const
 Output the formatted data to a stream. Adds appropriate messages to the error list when the operation fails. More...
 
template<typename DATASOURCE >
void toStream (std::ostream &outputStream, DATASOURCE const &tableData) const
 Output the formatted data to a stream. Adds appropriate messages to the error list when the operation fails. More...
 
template<>
string toString (TableData const &tableData) const
 Convert a TableData to a table string. More...
 
template<>
string toString (TableFunction const &tableData) const
 Template specialisation to convert a TableFunction to a CSV string. More...
 
- Public Member Functions inherited from geos::TableFormatter
TableErrorListinggetErrorsList () const
 

Additional Inherited Members

- Protected Types inherited from geos::TableTextFormatter
using ColumnWidthModifier = std::function< void(stdVector< size_t > &) >
 A functor which allow to customize the columns width after their computation.
 
- Protected Member Functions inherited from geos::TableTextFormatter
void initalizeTableGrids (PreparedTableLayout const &tableLayout, TableData const &tableData, CellLayoutRows &dataCellsLayout, CellLayoutRows &headerCellsLayout, CellLayoutRows &errorCellsLayout, size_t &tableTotalWidth, ColumnWidthModifier columnWidthModifier) const
 Initializes the table layout with the given table data and prepares necessary layouts for headers and data cells. More...
 
void outputTableHeader (std::ostream &tableOutput, PreparedTableLayout const &tableLayout, CellLayoutRows const &headerCellsLayout, string_view separatorLine) const
 Outputs the top part of the formatted table to the provided output stream. More...
 
void outputTableData (std::ostream &tableOutput, PreparedTableLayout const &tableLayout, CellLayoutRows const &dataCellsLayout) const
 Outputs the data part of the formatted table to the provided output stream. More...
 
void outputTableFooter (std::ostream &tableOutput, PreparedTableLayout const &tableLayout, CellLayoutRows &errorCellsLayout, string_view separatorLine, bool hasData) const
 Outputs the bottom part of the formatted table to the provided output stream. More...
 
- Protected Member Functions inherited from geos::TableFormatter
 TableFormatter ()
 Construct a default Table Formatter without layout specification (to only insert data in it, without any column / title). Feature is not tested.
 
 TableFormatter (TableLayout const &tableLayout)
 Construct a new Table Formatter from a tableLayout. More...
 
void toStreamImpl (std::ostream &outputStream, string_view content) const
 Implements the actual writing of content to an output stream. Adds appropriate messages to the error list when the operation fails. More...
 
- Protected Attributes inherited from geos::TableFormatter
PreparedTableLayout const m_tableLayout
 Layout for a table.
 
std::unique_ptr< geos::TableErrorListingm_errors = std::make_unique< geos::TableErrorListing >()
 Class used for listing all errors that may have occured during table generation.
 
- Static Protected Attributes inherited from geos::TableTextFormatter
static constexpr char m_verticalLine = '|'
 symbol for separator construction
 
static constexpr char m_horizontalLine = '-'
 for the extremity of a row
 

Detailed Description

class to format data in a formatted text format, allowing contributions from multiple MPI ranks.

Definition at line 45 of file TableMpiComponents.hpp.

Constructor & Destructor Documentation

◆ TableTextMpiOutput() [1/2]

geos::TableTextMpiOutput::TableTextMpiOutput ( TableMpiLayout  mpiLayout = TableMpiLayout())

Construct a default Table Formatter without layout specification (to only insert data in it, without any column / title). Feature is not tested.

Parameters
mpiLayoutMPI-specific layout information (default is having contiguous ranks data).

◆ TableTextMpiOutput() [2/2]

geos::TableTextMpiOutput::TableTextMpiOutput ( TableLayout const &  tableLayout,
TableMpiLayout  mpiLayout = TableMpiLayout() 
)

Construct a new TableTextMpiOutput from a tableLayout.

Parameters
tableLayoutContain all tableColumnData names and optionnaly the table title
mpiLayoutMPI-specific layout information (default is having contiguous ranks data).

Member Function Documentation

◆ toStream()

template<typename DATASOURCE >
void geos::TableTextMpiOutput::toStream ( std::ostream &  outputStream,
DATASOURCE const &  tableData 
) const

Convert a data source to a table string.

Parameters
tableDataThe data source to convert.
outputStreamThe target output stream for rank 0, to output the table string representation of the TableData. Each rank contributing to the common rank 0 output stream with their local data. It may be the log or a file stream.
Note
This method must be called by all MPI ranks.

The documentation for this class was generated from the following file: