Teuchos::TabularOutputter Class Reference

Utility class that makes it easy to create formatted tables of output. More...

#include <Teuchos_TabularOutputter.hpp>

List of all members.

Classes

struct  FieldSpec
class  InvalidFieldOutputError
  More...
class  InvalidFieldSpecError
  More...
class  MissingFieldsError
  More...
class  MissingHeaderError
  More...

Public Member Functions

 TabularOutputter (std::ostream &out)
 
 TabularOutputter (const RCP< std::ostream > &out)
 
void setOStream (const RCP< std::ostream > &out)
 Set the ostream that all output will be sent to.
void pushFieldSpec (const std::string &fieldName, const EFieldType fieldType=DOUBLE, const EFieldJustification fieldJustification=RIGHT, const EFloatingOutputType floatingOutputType=SCIENTIFIC, const int width=-1)
 Add a new field to be output.
void setFieldTypePrecision (const EFieldType fieldType, const int prec)
 Set the precision of output for a field.
void outputHeader ()
 Output the headers.
template<typename T >
void outputField (const T &t)
 Output to the next field.
void nextRow (const bool allowRemainingFields=false)
 Finalize the row of output.
void startTimer (const int numLoops)
double stopTimer ()

Private Member Functions

void initialize ()
double adjustTime (const double &time_in)
 TabularOutputter ()

Private Attributes

Array< FieldSpecfieldSpecs_
RCP< FancyOStreamout_
Tuple< int, numFieldTypes > fieldTypePrecision_
int currFieldIdx_
Time timer_
int numLoops_

Static Private Attributes

static const std::string fieldSpacer_

Public types



enum  EFieldType { DOUBLE, INT, STRING }
  More...
enum  { numFieldTypes = 3 }
enum  EFieldJustification { LEFT, RIGHT }
  More...
enum  { numFieldJustifications = 2 }
enum  EFloatingOutputType { SCIENTIFIC, GENERAL }
  More...
enum  { numFloatingOutputTypes = 2 }

Detailed Description

Utility class that makes it easy to create formatted tables of output.

Definition at line 48 of file Teuchos_TabularOutputter.hpp.


Member Enumeration Documentation

Enumerator:
DOUBLE 
INT 
STRING 

Definition at line 55 of file Teuchos_TabularOutputter.hpp.

anonymous enum
Enumerator:
numFieldTypes 

Definition at line 56 of file Teuchos_TabularOutputter.hpp.

Enumerator:
LEFT 
RIGHT 

Definition at line 59 of file Teuchos_TabularOutputter.hpp.

anonymous enum
Enumerator:
numFieldJustifications 

Definition at line 60 of file Teuchos_TabularOutputter.hpp.

Enumerator:
SCIENTIFIC 
GENERAL 

Definition at line 63 of file Teuchos_TabularOutputter.hpp.

anonymous enum
Enumerator:
numFloatingOutputTypes 

Definition at line 64 of file Teuchos_TabularOutputter.hpp.


Constructor & Destructor Documentation

Teuchos::TabularOutputter::TabularOutputter ( std::ostream &  out  ) 

Definition at line 71 of file Teuchos_TabularOutputter.cpp.

Teuchos::TabularOutputter::TabularOutputter ( const RCP< std::ostream > &  out  ) 

Definition at line 79 of file Teuchos_TabularOutputter.cpp.

Teuchos::TabularOutputter::TabularOutputter (  )  [private]

Member Function Documentation

void Teuchos::TabularOutputter::setOStream ( const RCP< std::ostream > &  out  ) 

Set the ostream that all output will be sent to.

Definition at line 87 of file Teuchos_TabularOutputter.cpp.

void Teuchos::TabularOutputter::pushFieldSpec ( const std::string &  fieldName,
const EFieldType  fieldType = DOUBLE,
const EFieldJustification  fieldJustification = RIGHT,
const EFloatingOutputType  floatingOutputType = SCIENTIFIC,
const int  width = -1 
)

Add a new field to be output.

Definition at line 96 of file Teuchos_TabularOutputter.cpp.

void Teuchos::TabularOutputter::setFieldTypePrecision ( const EFieldType  fieldType,
const int  prec 
)

Set the precision of output for a field.

This will also determine the width of the field.

Definition at line 122 of file Teuchos_TabularOutputter.cpp.

void Teuchos::TabularOutputter::outputHeader (  ) 

Output the headers.

Definition at line 129 of file Teuchos_TabularOutputter.cpp.

template<typename T >
void Teuchos::TabularOutputter::outputField ( const T &  t  )  [inline]

Output to the next field.

Definition at line 212 of file Teuchos_TabularOutputter.hpp.

void Teuchos::TabularOutputter::nextRow ( const bool  allowRemainingFields = false  ) 

Finalize the row of output.

Definition at line 170 of file Teuchos_TabularOutputter.cpp.

void Teuchos::TabularOutputter::initialize (  )  [private]

Definition at line 196 of file Teuchos_TabularOutputter.cpp.

double Teuchos::TabularOutputter::adjustTime ( const double &  time_in  )  [inline, private]

Definition at line 158 of file Teuchos_TabularOutputter.hpp.

void Teuchos::TabularOutputter::startTimer ( const int  numLoops  )  [inline]

Definition at line 165 of file Teuchos_TabularOutputter.hpp.

double Teuchos::TabularOutputter::stopTimer (  )  [inline]

Definition at line 172 of file Teuchos_TabularOutputter.hpp.


Member Data Documentation

const std::string Teuchos::TabularOutputter::fieldSpacer_ [static, private]

Definition at line 143 of file Teuchos_TabularOutputter.hpp.

Definition at line 145 of file Teuchos_TabularOutputter.hpp.

Definition at line 146 of file Teuchos_TabularOutputter.hpp.

Definition at line 147 of file Teuchos_TabularOutputter.hpp.

Definition at line 149 of file Teuchos_TabularOutputter.hpp.

Definition at line 151 of file Teuchos_TabularOutputter.hpp.

Definition at line 152 of file Teuchos_TabularOutputter.hpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on Tue Oct 20 10:14:05 2009 for Teuchos Package Browser (Single Doxygen Collection) by  doxygen 1.6.1