Go to the documentation of this file.
25 #include "libmesh/reference_counter.h"
34 #if defined(LIBMESH_ENABLE_REFERENCE_COUNTING) && defined(DEBUG)
49 #if defined(LIBMESH_ENABLE_REFERENCE_COUNTING) && defined(DEBUG)
51 std::ostringstream oss;
54 <<
" ---------------------------------------------------------------------------- \n"
55 <<
"| Reference count information |\n"
56 <<
" ---------------------------------------------------------------------------- \n";
60 const std::string
name(pr.first);
61 const unsigned int creations = pr.second.first;
62 const unsigned int destructions = pr.second.second;
64 oss <<
"| " <<
name <<
" reference count information:\n"
65 <<
"| Creations: " << creations <<
'\n'
66 <<
"| Destructions: " << destructions <<
'\n';
69 oss <<
" ---------------------------------------------------------------------------- \n";
85 #if defined(LIBMESH_ENABLE_REFERENCE_COUNTING) && defined(DEBUG)
The libMesh namespace provides an interface to certain functionality in the library.
std::map< std::string, std::pair< unsigned int, unsigned int > > Counts
Data structure to log the information.
static Counts _counts
Actually holds the data.
static Threads::atomic< unsigned int > _n_objects
The number of objects.
static std::string get_info()
Gets a string containing the reference information.
tbb::spin_mutex spin_mutex
Spin mutex.
static void print_info(std::ostream &out=libMesh::out)
Prints the reference information, by default to libMesh::out.
static void enable_print_counter_info()
Methods to enable/disable the reference counter output from print_info()
static bool _enable_print_counter
Flag to control whether reference count information is printed when print_info is called.
static void disable_print_counter_info()
std::string name(const ElemQuality q)
This function returns a string containing some name for q.
static Threads::spin_mutex _mutex
Mutual exclusion object to enable thread-safe reference counting.