21#include "libmesh/libmesh_singleton.h"
22#include "libmesh/threads.h"
23#include "libmesh/simple_range.h"
37typedef std::vector<Singleton *> SingletonList;
39SingletonList & get_singleton_cache()
41 static SingletonList singleton_cache;
42 return singleton_cache;
45typedef std::vector<Singleton::Setup *> SetupList;
46SetupList & 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();
static void cleanup()
Cleanup function.
static void setup()
Setup function.
The libMesh namespace provides an interface to certain functionality in the library.
SimpleRange< IndexType > as_range(const std::pair< IndexType, IndexType > &p)
Helper function that allows us to treat a homogenous pair as a range.