21 #include "libmesh/libmesh_singleton.h"
22 #include "libmesh/threads.h"
23 #include "libmesh/simple_range.h"
33 using namespace libMesh;
37 typedef std::vector<Singleton *> SingletonList;
39 SingletonList & get_singleton_cache()
41 static SingletonList singleton_cache;
42 return singleton_cache;
45 typedef std::vector<Singleton::Setup *> SetupList;
46 SetupList & get_setup_cache()
48 static SetupList setup_cache;
63 get_singleton_cache().push_back (
this);
70 get_setup_cache().push_back (
this);
77 SetupList & setup_cache = get_setup_cache();
79 for (
auto & item : setup_cache)
81 libmesh_assert (item);
90 SingletonList & singleton_cache = get_singleton_cache();
92 for (
auto & item : as_range(singleton_cache.rbegin(),
93 singleton_cache.rend()))
95 libmesh_assert (item);
100 singleton_cache.clear();
static void setup()
Setup function.
static void cleanup()
Cleanup function.