LCOV - code coverage report
Current view: top level - src/outputs - ConsoleStream.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: 39a256 Lines: 24 24 100.0 %
Date: 2026-07-14 14:36:17 Functions: 8 8 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : //* This file is part of the MOOSE framework
       2             : //* https://mooseframework.inl.gov
       3             : //*
       4             : //* All rights reserved, see COPYRIGHT for full restrictions
       5             : //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
       6             : //*
       7             : //* Licensed under LGPL 2.1, please see LICENSE for details
       8             : //* https://www.gnu.org/licenses/lgpl-2.1.html
       9             : 
      10             : // Moose includes
      11             : #include "ConsoleStream.h"
      12             : #include "MooseUtils.h"
      13             : #include "OutputWarehouse.h"
      14             : 
      15             : std::mutex ConsoleStream::_stream_mutex;
      16             : 
      17     6344386 : ConsoleStream::ConsoleStream(OutputWarehouse & output_warehouse)
      18     6344386 :   : _output_warehouse(output_warehouse), _oss(std::make_shared<std::ostringstream>())
      19             : {
      20     6344386 : }
      21             : 
      22             : const ConsoleStream &
      23     5021792 : ConsoleStream::operator<<(const StandardEndLine & manip) const
      24             : {
      25     5021792 :   const std::lock_guard<std::mutex> lock(_stream_mutex);
      26             : 
      27     5021792 :   if (manip == (std::basic_ostream<char> & (*)(std::basic_ostream<char> &)) & std::endl)
      28     1143128 :     (*_oss) << '\n';
      29             :   else
      30     3878664 :     (*_oss) << manip;
      31             : 
      32     5021792 :   _output_warehouse.mooseConsole(*_oss);
      33             : 
      34     5021792 :   return *this;
      35     5021792 : }
      36             : 
      37             : void
      38         268 : ConsoleStream::unsetf(std::ios_base::fmtflags mask) const
      39             : {
      40         268 :   _oss->unsetf(mask);
      41         268 : }
      42             : 
      43             : std::streamsize
      44     6848598 : ConsoleStream::precision() const
      45             : {
      46     6848598 :   return _oss->precision();
      47             : }
      48             : 
      49             : std::streamsize
      50     6841106 : ConsoleStream::precision(std::streamsize new_precision) const
      51             : {
      52     6841106 :   return _oss->precision(new_precision);
      53             : }
      54             : 
      55             : std::ios_base::fmtflags
      56     6848622 : ConsoleStream::flags() const
      57             : {
      58     6848622 :   return _oss->flags();
      59             : }
      60             : 
      61             : std::ios_base::fmtflags
      62     6840862 : ConsoleStream::flags(std::ios_base::fmtflags new_flags) const
      63             : {
      64     6840862 :   return _oss->flags(new_flags);
      65             : }
      66             : 
      67             : unsigned long long int
      68     1008453 : ConsoleStream::numPrinted() const
      69             : {
      70     1008453 :   return _output_warehouse.numPrinted();
      71             : }

Generated by: LCOV version 1.14