A helper class for re-directing output streams to Console output objects form MooseObjects. More...
#include <ConsoleStream.h>
Public Member Functions | |
ConsoleStream (OutputWarehouse &output_warehouse) | |
Constructor. More... | |
template<typename StreamType > | |
const ConsoleStream & | operator<< (const StreamType &s) const |
The output stream operator. More... | |
const ConsoleStream & | operator<< (const StandardEndLine &manip) const |
This overload is here to handle the the std::endl manipulator. More... | |
void | unsetf (std::ios_base::fmtflags mask) const |
Unset format flags. More... | |
std::streampos | tellp () const |
std::streamsize | precision () const |
Return the current precision. More... | |
std::streamsize | precision (std::streamsize new_precision) const |
Set the precision and return the old precision. More... | |
std::ios_base::fmtflags | flags () const |
Return the current flags. More... | |
std::ios_base::fmtflags | flags (std::ios_base::fmtflags new_flags) const |
Set the flags and return the old flags. More... | |
unsigned long long int | numPrinted () const |
The number of times something has been printed. More... | |
Private Attributes | |
OutputWarehouse & | _output_warehouse |
Reference to the OutputWarhouse that contains the Console output objects. More... | |
std::shared_ptr< std::ostringstream > | _oss |
The stream for buffering the message This stupidly has to be a shared pointer because of something in AutomaticMortarGeneration that requires this to be trivially copyable. More... | |
A helper class for re-directing output streams to Console output objects form MooseObjects.
Definition at line 30 of file ConsoleStream.h.
ConsoleStream::ConsoleStream | ( | OutputWarehouse & | output_warehouse | ) |
Constructor.
output_warehouse | A reference to the OutputWarehouse containing the Console outputs |
ConsoleStreamInterface contains an instance of this object, which allows message streams to be transferred to Console output objects. This class simply provides an operator<< method that passes the stream to the Console objects.
Definition at line 17 of file ConsoleStream.C.
std::ios_base::fmtflags ConsoleStream::flags | ( | ) | const |
Return the current flags.
Definition at line 58 of file ConsoleStream.C.
Referenced by SystemBase::applyScalingFactors().
std::ios_base::fmtflags ConsoleStream::flags | ( | std::ios_base::fmtflags | new_flags | ) | const |
Set the flags and return the old flags.
Definition at line 64 of file ConsoleStream.C.
unsigned long long int ConsoleStream::numPrinted | ( | ) | const |
The number of times something has been printed.
Definition at line 70 of file ConsoleStream.C.
Referenced by PerfGraph::addToExecutionList(), PerfGraphLivePrint::printLiveMessage(), PerfGraphLivePrint::printStats(), and PerfGraphLivePrint::start().
const ConsoleStream & ConsoleStream::operator<< | ( | const StreamType & | s | ) | const |
The output stream operator.
s | The data to be output to the Console objects |
This allows any object to uses _console to write to the Console: _console << "The combination to the air lock is " << 12345 << std::endl;
Definition at line 105 of file ConsoleStream.h.
const ConsoleStream & ConsoleStream::operator<< | ( | const StandardEndLine & | manip | ) | const |
This overload is here to handle the the std::endl manipulator.
Definition at line 25 of file ConsoleStream.C.
std::streamsize ConsoleStream::precision | ( | ) | const |
Return the current precision.
Definition at line 46 of file ConsoleStream.C.
Referenced by SystemBase::applyScalingFactors().
std::streamsize ConsoleStream::precision | ( | std::streamsize | new_precision | ) | const |
Set the precision and return the old precision.
Definition at line 52 of file ConsoleStream.C.
|
inline |
Definition at line 63 of file ConsoleStream.h.
void ConsoleStream::unsetf | ( | std::ios_base::fmtflags | mask | ) | const |
Unset format flags.
Definition at line 40 of file ConsoleStream.C.
Referenced by SystemBase::applyScalingFactors().
|
mutableprivate |
The stream for buffering the message This stupidly has to be a shared pointer because of something in AutomaticMortarGeneration that requires this to be trivially copyable.
Definition at line 98 of file ConsoleStream.h.
Referenced by flags(), operator<<(), precision(), tellp(), and unsetf().
|
private |
Reference to the OutputWarhouse that contains the Console output objects.
Definition at line 92 of file ConsoleStream.h.
Referenced by numPrinted(), and operator<<().