#include <BESGlobalInit.h>
Inheritance diagram for BESGlobalInit:
Public Member Functions | |
BESGlobalInit (BESInitFun, BESTermFun, BESInitializer *nextInit, int lvl) | |
Construct an initializer object that will handle the initialization and termination of a global object. | |
virtual | ~BESGlobalInit (void) |
virtual bool | initialize (int argc, char **argv) |
Method used to traverse a level of initialization functions. | |
virtual bool | terminate (void) |
Method used to traverse a level of termination functions. | |
virtual void | dump (ostream &strm) const |
dumps information about this object |
BESGlobalInit is an implementation of the abstration BESInitializer that provides the orderly initialization and termination of global objects. C++ does not provide such a mechanism, as global objects are created in random order. This gives the user more control over that ordering.
For a complete understanding of this global initialization mechanism please see the BESGlobalIQ documentation.
BESGlobalInit::BESGlobalInit | ( | BESInitFun | initFun, | |
BESTermFun | termFun, | |||
BESInitializer * | nextInit, | |||
int | lvl | |||
) |
Construct an initializer object that will handle the initialization and termination of a global object.
To use this object please refer to the BESGlobalIQ documentation. It will provide the information necessary to order the initialization of your global objects including step-by-step instructions.
initFun | Function used to initialize your global object | |
termFun | Function used to terminate, destroy, or clean up your global object | |
nextInit | The Next BESInitializer object that holds on to the initialization and termination functions for another global object | |
lvl | initialization level. There are different levels of initialization, which provides the ordering. Objects at the same level are initialized in random order. |
BESGlobalInit::~BESGlobalInit | ( | void | ) | [virtual] |
void BESGlobalInit::dump | ( | ostream & | strm | ) | const [virtual] |
dumps information about this object
Displays the pointer value of this instance
strm | C++ i/o stream to dump the information to |
Implements BESInitializer.
bool BESGlobalInit::initialize | ( | int | argc, | |
char ** | argv | |||
) | [virtual] |
Method used to traverse a level of initialization functions.
There can be multiple levels of initialization. Level 0 will be the first global initialization functions run, level 1 will be the next set of initialization functions run. This method will run the level of objects for the level specified in the constructor.
Again, see the BESGlobalIQ documentation for a full description of how to use the global initialization mechanism.
argc | number of arguments passed in the argv argument list. This is the same as the command line argc. | |
argv | the arguments passed to the initialization function. This is the same as the command line arguments argv. |
Implements BESInitializer.
bool BESGlobalInit::terminate | ( | void | ) | [virtual] |
Method used to traverse a level of termination functions.
There can be multiple levels of initialization. Level 0 will be the first global termination functions run, level 1 will be the next set of termination functions run. This method will run the level of objects for the level specified in the constructor.
Again, see the BESGlobalIQ documentation for a full description of how to use the global initialization mechanism.
Implements BESInitializer.