This is the base class for enabling reference counting. 更多...
#include <reference_counter.h>
Public 成员函数 | |
~ReferenceCounter () | |
Destructor. 更多... | |
静态 Public 成员函数 | |
static std::string | get_info () |
Gets a string containing the reference information. 更多... | |
static void | print_info (std::ostream &out_stream=libMesh::out) |
Prints the reference information, by default to libMesh::out . 更多... | |
static unsigned int | n_objects () |
Prints the number of outstanding (created, but not yet destroyed) objects. 更多... | |
static void | enable_print_counter_info () |
Methods to enable/disable the reference counter output from print_info() 更多... | |
static void | disable_print_counter_info () |
Protected 类型 | |
typedef std::map< std::string, std::pair< unsigned int, unsigned int > > | Counts |
Data structure to log the information. 更多... | |
Protected 成员函数 | |
ReferenceCounter () | |
Constructors. 更多... | |
ReferenceCounter (const ReferenceCounter &) | |
ReferenceCounter (ReferenceCounter &&other) noexcept | |
Move constructor, must be declared noexcept. 更多... | |
void | increment_constructor_count (const std::string &name) noexcept |
Increments the construction counter. 更多... | |
void | increment_destructor_count (const std::string &name) noexcept |
Increments the destruction counter. 更多... | |
静态 Protected 属性 | |
static Counts | _counts |
Actually holds the data. 更多... | |
static Threads::atomic < unsigned int > | _n_objects |
The number of objects. 更多... | |
static Threads::spin_mutex | _mutex |
Mutual exclusion object to enable thread-safe reference counting. 更多... | |
static bool | _enable_print_counter = true |
Flag to control whether reference count information is printed when print_info is called. 更多... | |
This is the base class for enabling reference counting.
It should not be used by the user, thus it has a private constructor.
在文件 reference_counter.h 第 46 行定义.
|
protected |
Data structure to log the information.
The log is identified by the class name.
在文件 reference_counter.h 第 119 行定义.
|
inlineprotected |
Constructors.
Protected so that you cannot instantiate a ReferenceCounter
, only derive from it.
在文件 reference_counter.h 第 150 行定义.
参考 _n_objects.
|
inlineprotected |
在文件 reference_counter.h 第 157 行定义.
参考 _n_objects.
|
inlineprotectednoexcept |
Move constructor, must be declared noexcept.
在文件 reference_counter.h 第 164 行定义.
参考 _n_objects.
|
inline |
Destructor.
在文件 reference_counter.h 第 171 行定义.
参考 _n_objects.
|
static |
在文件 reference_counter.C 第 100 行定义.
|
static |
Methods to enable/disable the reference counter output from print_info()
在文件 reference_counter.C 第 94 行定义.
|
static |
Gets a string containing the reference information.
在文件 reference_counter.C 第 47 行定义.
参考 _counts.
参考自 print_info().
|
inlineprotectednoexcept |
Increments the construction counter.
Should be called in the constructor of any derived class that will be reference counted.
在文件 reference_counter.h 第 183 行定义.
参考 libMesh::err.
参考自 libMesh::ReferenceCountedObject< SparseMatrix< T > >::ReferenceCountedObject().
|
inlineprotectednoexcept |
Increments the destruction counter.
Should be called in the destructor of any derived class that will be reference counted.
在文件 reference_counter.h 第 207 行定义.
参考 libMesh::err.
参考自 libMesh::ReferenceCountedObject< SparseMatrix< T > >::~ReferenceCountedObject().
|
inlinestatic |
Prints the number of outstanding (created, but not yet destroyed) objects.
在文件 reference_counter.h 第 85 行定义.
参考 _n_objects.
参考自 libMesh::LibMeshInit::~LibMeshInit().
|
static |
Prints the reference information, by default to libMesh::out
.
在文件 reference_counter.C 第 81 行定义.
参考 _enable_print_counter , 以及 get_info().
参考自 libMesh::LibMeshInit::~LibMeshInit().
|
staticprotected |
|
staticprotected |
Flag to control whether reference count information is printed when print_info is called.
在文件 reference_counter.h 第 143 行定义.
参考自 disable_print_counter_info(), enable_print_counter_info() , 以及 print_info().
|
staticprotected |
Mutual exclusion object to enable thread-safe reference counting.
在文件 reference_counter.h 第 137 行定义.
|
staticprotected |
The number of objects.
Print the reference count information when the number returns to 0.
在文件 reference_counter.h 第 132 行定义.
参考自 n_objects(), ReferenceCounter() , 以及 ~ReferenceCounter().