oomph::OomphInfo Class Reference

#include <oomph_definitions.h>

Public Member Functions

 OomphInfo ()
 
template<class _Tp >
std::ostream & operator<< (_Tp argument)
 
std::ostream *& stream_pt ()
 Access function for the stream pointer. More...
 
std::ostream & operator<< (std::ostream &(*f)(std::ostream &))
 Overload insertor to handle stream modifiers. More...
 
OutputModifier *& output_modifier_pt ()
 Access function for the output modifier pointer. More...
 

Private Attributes

std::ostream * Stream_pt
 Pointer to the output stream – defaults to std::cout. More...
 
OutputModifierOutput_modifier_pt
 Pointer to the output modifier object – defaults to no modification. More...
 

Detailed Description

///////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////// This class is a wrapper to a stream and an output modifier that is used to control the "info" output from OomphLib. Its instationiation can be used like std::cout.

Constructor & Destructor Documentation

◆ OomphInfo()

oomph::OomphInfo::OomphInfo ( )
inline

Set default values for the output stream (cout) and modifier (no modification)

443  {
444  }
std::ostream * Stream_pt
Pointer to the output stream – defaults to std::cout.
Definition: oomph_definitions.h:433
OutputModifier * Output_modifier_pt
Pointer to the output modifier object – defaults to no modification.
Definition: oomph_definitions.h:436
OutputModifier default_output_modifier
Single global instatiation of the default output modifier.
Definition: oomph_definitions.cc:325

Member Function Documentation

◆ operator<<() [1/2]

template<class _Tp >
std::ostream& oomph::OomphInfo::operator<< ( _Tp  argument)
inline

Overload the << operator, writing output to the stream addressed by Stream_pt and calling the function defined by the object addressed by Output_modifier_pt

451  {
452  // If the Output_modifer function returns true
453  // echo the argument to the stream and return the (vanilla) stream
454  if ((*Output_modifier_pt)(*Stream_pt))
455  {
456  *Stream_pt << argument;
457  return (*Stream_pt);
458  }
459  // Otherwise return the null stream (suppress all future output)
460  return oomph_nullstream;
461  }
Nullstream oomph_nullstream
Single (global) instantiation of the Nullstream.
Definition: oomph_definitions.cc:313

References oomph::oomph_nullstream, and GlobalParameters::Stream_pt.

◆ operator<<() [2/2]

std::ostream& oomph::OomphInfo::operator<< ( std::ostream &(*)(std::ostream &)  f)
inline

Overload insertor to handle stream modifiers.

471  {
472  return f(*Stream_pt);
473  }
static int f(const TensorMap< Tensor< int, 3 > > &tensor)
Definition: cxx11_tensor_map.cpp:237

References f(), and GlobalParameters::Stream_pt.

◆ output_modifier_pt()

OutputModifier*& oomph::OomphInfo::output_modifier_pt ( )
inline

Access function for the output modifier pointer.

477  {
478  return Output_modifier_pt;
479  }

Referenced by oomph::MPI_Helpers::init(), and main().

◆ stream_pt()

Member Data Documentation

◆ Output_modifier_pt

OutputModifier* oomph::OomphInfo::Output_modifier_pt
private

Pointer to the output modifier object – defaults to no modification.

◆ Stream_pt

std::ostream* oomph::OomphInfo::Stream_pt
private

Pointer to the output stream – defaults to std::cout.


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