Teuchos::TableFormat Class Reference

Encapsulation of formatting specifications for writing data in a clean tabular form. More...

#include <Teuchos_TableFormat.hpp>

List of all members.

Public Member Functions

 TableFormat ()
 Construct with a header and default format settings.
int pageWidth () const
 Get the maximum number of characters per line. Default is 80.
int precision () const
 Get the precision for writing doubles. Default is 4.
int columnSpacing () const
 Get the number of characters to be left as blank spaces in each column. Default is 4.
void setPageWidth (int pw) const
 Set the number of characters on a line. This quantity can be updated within the const method writeWholeTables().
void setPrecision (int p)
 Set the precision for writing doubles.
void setColumnSpacing (int columnSpacing)
 Set the number of characters to be left as blank spaces in each column.
void setRowsBetweenLines (int lineInterval)
 Set the interval at which a horizontal line will be written between rows.
string thinline () const
 Return a horizontal line in dashes "----" the width of the page.
string thickline () const
 Return a thick horizontal line in equal signs "====" the width of the page.
string blanks (int size) const
 Return a string full of blanks up to the requested size.
int computeRequiredColumnWidth (const string &name, const TableColumn &column) const
 Computes the column width required to write all values to the required precision.
void setColumnWidths (const Array< int > &colWidths)
 Set the column widths to be used for subsequent rows.
void writeRow (RefCountPtr< std::ostream > &out, const Array< RefCountPtr< TableEntry > > &entries) const
 Write the row of entries.
void writeRow (RefCountPtr< std::ostream > &out, int rowIndex, const Array< TableColumn > &columns) const
 Write the row of entries.


Detailed Description

Encapsulation of formatting specifications for writing data in a clean tabular form.

Note: it is left to the programmer to avoid invalid settings such as negative column spaces, zero page widths, and other such potentially bad things.

KL 30 Apr 2006 -- initial design.

Definition at line 52 of file Teuchos_TableFormat.hpp.


Constructor & Destructor Documentation

Teuchos::TableFormat::TableFormat  )  [inline]
 

Construct with a header and default format settings.

Definition at line 56 of file Teuchos_TableFormat.hpp.


Member Function Documentation

int Teuchos::TableFormat::pageWidth  )  const [inline]
 

Get the maximum number of characters per line. Default is 80.

Definition at line 63 of file Teuchos_TableFormat.hpp.

int Teuchos::TableFormat::precision  )  const [inline]
 

Get the precision for writing doubles. Default is 4.

Definition at line 67 of file Teuchos_TableFormat.hpp.

int Teuchos::TableFormat::columnSpacing  )  const [inline]
 

Get the number of characters to be left as blank spaces in each column. Default is 4.

Definition at line 71 of file Teuchos_TableFormat.hpp.

void Teuchos::TableFormat::setPageWidth int  pw  )  const [inline]
 

Set the number of characters on a line. This quantity can be updated within the const method writeWholeTables().

Definition at line 76 of file Teuchos_TableFormat.hpp.

void Teuchos::TableFormat::setPrecision int  p  )  [inline]
 

Set the precision for writing doubles.

Definition at line 79 of file Teuchos_TableFormat.hpp.

void Teuchos::TableFormat::setColumnSpacing int  columnSpacing  )  [inline]
 

Set the number of characters to be left as blank spaces in each column.

Definition at line 82 of file Teuchos_TableFormat.hpp.

void Teuchos::TableFormat::setRowsBetweenLines int  lineInterval  )  [inline]
 

Set the interval at which a horizontal line will be written between rows.

lineInterval [in] the number of rows between each horizontal line

Definition at line 89 of file Teuchos_TableFormat.hpp.

string TableFormat::thinline  )  const
 

Return a horizontal line in dashes "----" the width of the page.

Originally called hbar, but changed to avoid possible confusion for physicists expecting hbar() to return $1.05457168e-34$ :-).

Definition at line 34 of file Teuchos_TableFormat.cpp.

string TableFormat::thickline  )  const
 

Return a thick horizontal line in equal signs "====" the width of the page.

Definition at line 46 of file Teuchos_TableFormat.cpp.

string TableFormat::blanks int  size  )  const
 

Return a string full of blanks up to the requested size.

Definition at line 57 of file Teuchos_TableFormat.cpp.

int TableFormat::computeRequiredColumnWidth const string &  name,
const TableColumn column
const
 

Computes the column width required to write all values to the required precision.

Parameters:
name [in] the title of the column
column [in] the column data
Postcondition: colString.size()==values.size()

Definition at line 70 of file Teuchos_TableFormat.cpp.

void Teuchos::TableFormat::setColumnWidths const Array< int > &  colWidths  )  [inline]
 

Set the column widths to be used for subsequent rows.

Definition at line 117 of file Teuchos_TableFormat.hpp.

void TableFormat::writeRow RefCountPtr< std::ostream > &  out,
const Array< RefCountPtr< TableEntry > > &  entries
const
 

Write the row of entries.

Parameters:
out [in/out] the output stream to which the row will be written
entries [in] the data to be written into this row. Each array element is the entry for a column on this row.

Definition at line 87 of file Teuchos_TableFormat.cpp.

void TableFormat::writeRow RefCountPtr< std::ostream > &  out,
int  rowIndex,
const Array< TableColumn > &  columns
const
 

Write the row of entries.

Parameters:
out [in/out] the output stream to which the row will be written
columns [in] the columns of data from which this row is to be sliced
rowIndex [in] the index into the columns used to obtain the values for this row

Definition at line 104 of file Teuchos_TableFormat.cpp.


The documentation for this class was generated from the following files:
Generated on Thu Sep 18 12:30:32 2008 for Teuchos - Trilinos Tools Package by doxygen 1.3.9.1