libMesh::PerfItem Struct Reference

#include <libmesh_logging.h>

Public Member Functions

 PerfItem (const char *label, const char *header, bool enabled=true)
 
 ~PerfItem ()
 

Private Attributes

const char * _label
 
const char * _header
 
bool _enabled
 

Detailed Description

Used for logging something that naturally lasts as long as some enclosing scope, such as the current function. Makes it very easy to handle multiple return scenarios, since the event is popped in the destructor. Should not be used directly, instead use the LOG_SCOPE macro, which resolves to nothing at compile time if logging is disabled.

Author
John Peterson
Date
2016

Definition at line 64 of file libmesh_logging.h.

Constructor & Destructor Documentation

libMesh::PerfItem::PerfItem ( const char *  label,
const char *  header,
bool  enabled = true 
)
inline

Definition at line 66 of file libmesh_logging.h.

References _enabled, libMesh::perflog, and libMesh::PerfLog::push().

68  :
69  _label(label),
70  _header(header),
71  _enabled(enabled)
72  {
73  if (_enabled)
74  libMesh::perflog.push(label, header);
75  }
const char * _header
void push(const char *label, const char *header="")
Definition: perf_log.h:402
const char * _label
PerfLog perflog("libMesh",#ifdef LIBMESH_ENABLE_PERFORMANCE_LOGGING true#else false#endif)
libMesh::PerfItem::~PerfItem ( )
inline

Definition at line 77 of file libmesh_logging.h.

References _enabled, _header, _label, libMesh::perflog, and libMesh::PerfLog::pop().

78  {
79  if (_enabled)
81  }
void pop(const char *label, const char *header="")
Definition: perf_log.h:447
const char * _header
const char * _label
PerfLog perflog("libMesh",#ifdef LIBMESH_ENABLE_PERFORMANCE_LOGGING true#else false#endif)

Member Data Documentation

bool libMesh::PerfItem::_enabled
private

Definition at line 86 of file libmesh_logging.h.

Referenced by PerfItem(), and ~PerfItem().

const char* libMesh::PerfItem::_header
private

Definition at line 85 of file libmesh_logging.h.

Referenced by ~PerfItem().

const char* libMesh::PerfItem::_label
private

Definition at line 84 of file libmesh_logging.h.

Referenced by ~PerfItem().


The documentation for this struct was generated from the following file: