libMesh
Public Member Functions | Private Attributes | List of all members
libMesh::Threads::DisablePerfLogInScope Class Reference

We use a class to turn perf logging off and on within threads, to be exception-safe and to avoid forcing indirect inclusion of libmesh_logging.h everywhere. More...

#include <threads.h>

Public Member Functions

 DisablePerfLogInScope ()=default
 
 ~DisablePerfLogInScope ()=default
 
 DisablePerfLogInScope ()
 
 ~DisablePerfLogInScope ()
 

Private Attributes

const bool _logging_was_enabled
 

Detailed Description

We use a class to turn perf logging off and on within threads, to be exception-safe and to avoid forcing indirect inclusion of libmesh_logging.h everywhere.

If we have logging disabled, constructing this class should do nothing; [[maybe_unused]] disables warnings about that.

Definition at line 72 of file threads.h.

Constructor & Destructor Documentation

◆ DisablePerfLogInScope() [1/2]

libMesh::Threads::DisablePerfLogInScope::DisablePerfLogInScope ( )
default

Definition at line 38 of file threads.C.

References libMesh::PerfLog::disable_logging(), and libMesh::perflog.

38  :
39  _logging_was_enabled(libMesh::perflog.logging_enabled())
40 {
42 }
PerfLog perflog
A PerfLog object to log performance.
void disable_logging()
Disables performance logging for an active object.
Definition: perf_log.h:176

◆ ~DisablePerfLogInScope() [1/2]

libMesh::Threads::DisablePerfLogInScope::~DisablePerfLogInScope ( )
default

Definition at line 44 of file threads.C.

References _logging_was_enabled, libMesh::PerfLog::enable_logging(), and libMesh::perflog.

45 {
48 }
void enable_logging()
Enables performance logging for an active object.
Definition: perf_log.h:181
PerfLog perflog
A PerfLog object to log performance.

◆ DisablePerfLogInScope() [2/2]

libMesh::Threads::DisablePerfLogInScope::DisablePerfLogInScope ( )

◆ ~DisablePerfLogInScope() [2/2]

libMesh::Threads::DisablePerfLogInScope::~DisablePerfLogInScope ( )

Member Data Documentation

◆ _logging_was_enabled

const bool libMesh::Threads::DisablePerfLogInScope::_logging_was_enabled
private

Definition at line 82 of file threads.h.

Referenced by ~DisablePerfLogInScope().


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