Sierra Toolkit  Version of the Day
Bootstrap.hpp
1 /*------------------------------------------------------------------------*/
2 /* Copyright 2010 Sandia Corporation. */
3 /* Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive */
4 /* license for use of this work by or on behalf of the U.S. Government. */
5 /* Export of this program may require a license from the */
6 /* United States Government. */
7 /*------------------------------------------------------------------------*/
8 
9 #ifndef STK_UTIL_UTIL_BOOTSTRAP_HPP
10 #define STK_UTIL_UTIL_BOOTSTRAP_HPP
11 
12 namespace stk_classic {
13 
18 
35 class Bootstrap
36 {
37 public:
38 
39  typedef void (*FunctionPtr)();
40 
46  static void bootstrap();
47 
56  Bootstrap(void (*f)());
57 
58 private:
59  Bootstrap(const Bootstrap &);
60  Bootstrap &operator=(const Bootstrap &);
61 
62 public:
63  ~Bootstrap()
64  {}
65 
66 private:
67  static Bootstrap * s_front;
68  static bool s_bootstrapped;
69 
70  Bootstrap * m_next;
71  FunctionPtr m_f;
72 };
73 
77 
78 } // namespace stk_classic
79 
80 #endif // STK_UTIL_UTIL_BOOTSTRAP_HPP
Bootstrap(void(*f)())
Creates a new Bootstrap instance.
Definition: Bootstrap.cpp:29
static void bootstrap()
Member function bootstrap runs through the stored bootstrap function pointers and executes each funct...
Definition: Bootstrap.cpp:21
Sierra Toolkit.
Class Bootstrap serves as a bootstrapping mechanism for products in the sierra toolkit and elsewhere...
Definition: Bootstrap.hpp:35