37 SingletonMutex singleton_mtx, setup_mtx;
41 typedef std::vector<Singleton *> SingletonList;
43 SingletonList & get_singleton_cache()
45 static SingletonList singleton_cache;
46 return singleton_cache;
49 typedef std::vector<Singleton::Setup *> SetupList;
50 SetupList & get_setup_cache()
52 static SetupList setup_cache;
67 SingletonMutex::scoped_lock lock(singleton_mtx);
69 get_singleton_cache().push_back (
this);
76 get_setup_cache().push_back (
this);
83 SingletonMutex::scoped_lock lock(setup_mtx);
85 SetupList & setup_cache = get_setup_cache();
87 for (
auto & item : setup_cache)
89 libmesh_assert (item);
98 SingletonMutex::scoped_lock lock(singleton_mtx);
100 SingletonList & singleton_cache = get_singleton_cache();
102 for (
auto & item :
as_range(singleton_cache.rbegin(),
103 singleton_cache.rend()))
105 libmesh_assert (item);
110 singleton_cache.clear();
SimpleRange< I > as_range(const std::pair< I, I > &p)