Most products need to register with other products to provide information such as product version, command line option, and diagnostic writers. The Bootstrap class provides a safe mechanism for these registrations to occur.

Bootstrapping occurs in two steps and requires two components, a callback function and a static bootstrap object. The construction of the static bootstrap object registers the callback function for later execution by main() and the callback function performs registrations such as registering product information, command line options and diagnostics writers.

By utilizing this mechanism, any modules which need to be bootstrapped can do so by being linked into the executable.

For example:

 #include <stk_util/util/Bootstrap.hpp>
 namespace {
 void bootstrap()
   boost::program_options::options_description desc("Use case options");
     ("performance", "run performance test")
     ("mesh", boost::program_options::value<std::string>(), "run mesh file performance test");
 stk::Bootstrap x(&bootstrap);
 } // namespace <empty>

Main contains the following function which executes the registered bootstrap functions.



The applications main executes the bootstrap functions causing the command line description to be fully populated.

Generated on Tue Jul 13 09:27:33 2010 for Sierra Toolkit by  doxygen 1.4.7