libmesh解析
本工作只是尝试解析原libmesh的代码,供学习使用
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 
| 静态 Public 成员函数 | Protected 成员函数 | 所有成员列表
libMesh::Singleton类 参考

Base class for all library singleton objects. 更多...

#include <libmesh_singleton.h>

class  Setup
 Abstract base class for runtime singleton setup. 更多...
 

静态 Public 成员函数

static void setup ()
 Setup function. 更多...
 
static void cleanup ()
 Cleanup function. 更多...
 

Protected 成员函数

 Singleton ()
 Constructor. 更多...
 
virtual ~Singleton ()=default
 Destructor. 更多...
 

详细描述

Base class for all library singleton objects.

作者
Benjamin S. Kirk
日期
2013 Base class for all library singleton objects.

在文件 libmesh_singleton.h35 行定义.

构造及析构函数说明

libMesh::Singleton::Singleton ( )
protected

Constructor.

Adds the derived object to the singleton cache list.

在文件 libmesh_singleton.C61 行定义.

62 {
63  get_singleton_cache().push_back (this);
64 }
virtual libMesh::Singleton::~Singleton ( )
protectedvirtualdefault

Destructor.

成员函数说明

void libMesh::Singleton::cleanup ( )
static

Cleanup function.

Removes all dynamically created Singleton objects.

在文件 libmesh_singleton.C88 行定义.

参考自 libMesh::LibMeshInit::~LibMeshInit().

89 {
90  SingletonList & singleton_cache = get_singleton_cache();
91 
92  for (auto & item : as_range(singleton_cache.rbegin(),
93  singleton_cache.rend()))
94  {
95  libmesh_assert (item);
96  delete item;
97  item = nullptr;
98  }
99 
100  singleton_cache.clear();
101 }
void libMesh::Singleton::setup ( )
static

Setup function.

Initializes any derived Singleton::Setup objects. objects.

在文件 libmesh_singleton.C75 行定义.

76 {
77  SetupList & setup_cache = get_setup_cache();
78 
79  for (auto & item : setup_cache)
80  {
81  libmesh_assert (item);
82  item->setup();
83  }
84 }

该类的文档由以下文件生成: