scc  2022.4.0
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 More...
 
 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 463 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

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