21 #include "libmesh/libmesh_singleton.h" 22 #include "libmesh/threads.h" 23 #include "libmesh/simple_range.h" 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)
90 SingletonList & singleton_cache = get_singleton_cache();
92 for (
auto & item :
as_range(singleton_cache.rbegin(),
93 singleton_cache.rend()))
100 singleton_cache.clear();
The libMesh namespace provides an interface to certain functionality in the library.
static void setup()
Setup function.
SimpleRange< IndexType > as_range(const std::pair< IndexType, IndexType > &p)
Helper function that allows us to treat a homogenous pair as a range.
static void cleanup()
Cleanup function.