scc 2025.09
SystemC components library
scc::stream_redirection Class Reference

stream redirector More...

#include <report.h>

Inheritance diagram for scc::stream_redirection:
Collaboration diagram for scc::stream_redirection:

Public Member Functions

 stream_redirection (std::ostream &os, log level)
 constructor redirecting the given stream to a SystemC log message of given llog level
 stream_redirection (stream_redirection const &)=delete
stream_redirectionoperator= (stream_redirection const &)=delete
 stream_redirection (stream_redirection &&)=delete
stream_redirectionoperator= (stream_redirection &&)=delete
 ~stream_redirection ()
 destructor restoring the output stream buffer
void reset ()
 reset the stream redirection and restore output buffer of the stream

Protected Member Functions

std::streamsize xsputn (const char_type *s, std::streamsize n) override
int sync () override

Protected Attributes

std::ostream & os
log level
std::streambuf * old_buf {nullptr}

Detailed Description

stream redirector

the stream redirector allows to redirect std::cout and std::cerr into SystemC log messages

Definition at line 489 of file report.h.

Constructor & Destructor Documentation

◆ stream_redirection()

scc::stream_redirection::stream_redirection ( std::ostream & os,
scc::log level )

constructor redirecting the given stream to a SystemC log message of given llog level

Parameters
osthe stream to be redirected
levelthe log level to use

◆ ~stream_redirection()

scc::stream_redirection::~stream_redirection ( )

destructor restoring the output stream buffer

Definition at line 334 of file report.cpp.

Member Function Documentation

◆ reset()

void scc::stream_redirection::reset ( )

reset the stream redirection and restore output buffer of the stream

Definition at line 338 of file report.cpp.

◆ sync()

auto scc::stream_redirection::sync ( )
overrideprotected

Definition at line 368 of file report.cpp.

◆ xsputn()

auto scc::stream_redirection::xsputn ( const char_type * s,
std::streamsize n )
overrideprotected

Definition at line 343 of file report.cpp.

Member Data Documentation

◆ level

log scc::stream_redirection::level
protected

Definition at line 524 of file report.h.

◆ old_buf

std::streambuf* scc::stream_redirection::old_buf {nullptr}
protected

Definition at line 525 of file report.h.

◆ os

std::ostream& scc::stream_redirection::os
protected

Definition at line 523 of file report.h.


The documentation for this class was generated from the following files:
  • /home/eyck/Projects/MINRES/SystemC-Components/src/sysc/scc/report.h
  • /home/eyck/Projects/MINRES/SystemC-Components/src/sysc/scc/report.cpp