stk::Bootstrap Class Reference

#include <Bootstrap.hpp>

List of all members.

Detailed Description

Class Bootstrap serves as a bootstrapping mechanism for products in the sierra toolkit and elsewhere.

Often, it is convenient to have a product perform registrations and other operations when linked into an application. One method of accomplishing this is to utilize a static object whose constructor perform these operations. However, static constructions are executed prior to main and in non-deterministc order. The later is particularly problematic if the constructor results in the usage of another static object which may not have been constructed yet.

So, the Bootstrap class creates a stack of callback functions that are executed, by main(), when Bootstrap::bootstrap() is called. These functions are still executed in a non-deterministic order, but all static constructions have occurred.

Definition at line 35 of file Bootstrap.hpp.

Public Types

typedef void(*) FunctionPtr ()

Public Member Functions

 Bootstrap (void(*f)())
 Creates a new Bootstrap instance.
 ~Bootstrap ()

Static Public Member Functions

static void bootstrap ()
 Member function bootstrap runs through the stored bootstrap function pointers and executes each function.

Constructor & Destructor Documentation

stk::Bootstrap::Bootstrap ( void(*)()  f  ) 

Creates a new Bootstrap instance.

The instance serves only to insert the specified function pointer to the bootstrap function list. If the bootstrapper has already been executed, the function is added to the list and executed immediately.

The documentation for this class was generated from the following files:
Generated on Tue Jul 13 09:27:33 2010 for Sierra Toolkit by  doxygen 1.4.7