QMCPACK
ReportEngine Class Reference

Final class and should not be derived. More...

+ Collaboration diagram for ReportEngine:

Public Member Functions

 ReportEngine (const std::string &cname, const std::string &fname)
 
 ~ReportEngine ()
 
void flush ()
 
void warning (const std::string &msg)
 
void error (const std::string &msg, bool fatal=false)
 
void echo (xmlNodePtr cur, bool recursive=false)
 

Static Public Member Functions

static void enableOutput ()
 

Private Member Functions

 ReportEngine (const ReportEngine &a)
 

Private Attributes

std::string ClassName
 class Name More...
 
std::string FuncName
 name of the current member function More...
 
std::vector< std::string > ArgList
 arguments More...
 
InfoStreamLogBuffer
 stream for log message More...
 

Static Private Attributes

static bool DoOutput = false
 

Detailed Description

Final class and should not be derived.

Definition at line 33 of file ProgressReportEngine.h.

Constructor & Destructor Documentation

◆ ReportEngine() [1/2]

ReportEngine ( const std::string &  cname,
const std::string &  fname 
)
inline

Definition at line 36 of file ProgressReportEngine.h.

References ReportEngine::ClassName, ReportEngine::DoOutput, InfoStream::flush(), ReportEngine::FuncName, and ReportEngine::LogBuffer.

37  : ClassName(cname), FuncName(fname), LogBuffer(infoDebug)
38  {
39  if (DoOutput)
40  {
41  LogBuffer << " " << ClassName << "::" << FuncName << '\n';
42  LogBuffer.flush(); //always flush
43  }
44  }
std::string FuncName
name of the current member function
InfoStream infoDebug
InfoStream & LogBuffer
stream for log message
void flush()
flush stream buffer
Definition: InfoStream.cpp:39
std::string ClassName
class Name

◆ ~ReportEngine()

~ReportEngine ( )
inline

Definition at line 46 of file ProgressReportEngine.h.

References InfoStream::flush(), and ReportEngine::LogBuffer.

47  {
48  LogBuffer.flush();
49  }
InfoStream & LogBuffer
stream for log message
void flush()
flush stream buffer
Definition: InfoStream.cpp:39

◆ ReportEngine() [2/2]

ReportEngine ( const ReportEngine a)
inlineprivate

Definition at line 87 of file ProgressReportEngine.h.

87 : LogBuffer(infoDebug) {}
InfoStream infoDebug
InfoStream & LogBuffer
stream for log message

Member Function Documentation

◆ echo()

void echo ( xmlNodePtr  cur,
bool  recursive = false 
)

Definition at line 20 of file ProgressReportEngine.cpp.

References app_debug.

Referenced by AOBasisBuilder< COT >::put().

21 {
22  if (cur == nullptr)
23  return;
24  app_debug() << R"(<input node=")" << (const char*)(cur->name) << '"';
25  xmlAttrPtr att = cur->properties;
26  while (att != nullptr)
27  {
28  app_debug() << " " << (const char*)(att->name) << R"(=")" << (const char*)(att->children->content) << '"';
29  att = att->next;
30  }
31  app_debug() << R"(/>\n)";
32 }
#define app_debug
Definition: OutputManager.h:75

◆ enableOutput()

static void enableOutput ( )
inlinestatic

Definition at line 71 of file ProgressReportEngine.h.

References ReportEngine::DoOutput.

Referenced by main().

71 { DoOutput = true; }

◆ error()

◆ flush()

void flush ( )
inline

Definition at line 51 of file ProgressReportEngine.h.

References ReportEngine::DoOutput, InfoStream::flush(), and ReportEngine::LogBuffer.

Referenced by SPOSetBuilderFactory::createSPOSetBuilder().

52  {
53  if (DoOutput)
54  {
55  LogBuffer << '\n';
56  LogBuffer.flush();
57  }
58  }
InfoStream & LogBuffer
stream for log message
void flush()
flush stream buffer
Definition: InfoStream.cpp:39

◆ warning()

void warning ( const std::string &  msg)
inline

Definition at line 60 of file ProgressReportEngine.h.

References ReportEngine::LogBuffer.

Referenced by RadialJastrowBuilder::createJ2().

60 { LogBuffer << ("WARNING: " + msg + '\n'); }
InfoStream & LogBuffer
stream for log message

Member Data Documentation

◆ ArgList

std::vector<std::string> ArgList
private

arguments

Definition at line 82 of file ProgressReportEngine.h.

◆ ClassName

std::string ClassName
private

class Name

Definition at line 76 of file ProgressReportEngine.h.

Referenced by ReportEngine::error(), and ReportEngine::ReportEngine().

◆ DoOutput

bool DoOutput = false
staticprivate

◆ FuncName

std::string FuncName
private

name of the current member function

Definition at line 79 of file ProgressReportEngine.h.

Referenced by ReportEngine::error(), and ReportEngine::ReportEngine().

◆ LogBuffer

InfoStream& LogBuffer
private

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