FX::FXProcess_StaticInit< type > Class Template Reference

#include <FXProcess.h>

Inherits FX::FXProcess_StaticInitBase.

List of all members.


Detailed Description

template<class type>
class FX::FXProcess_StaticInit< type >

Lets you initialise static data in an orderly fashion.

Due to the C++ spec not guaranteeing an order of static data construction and furthermore lacking the ability to portably specify an order, we have provided this class which will construct the specified object just at the end of the FXProcess constructor and destruct it again just at the beginning of the FXProcess destructor. This is very useful for objects which require an intact and functional environment to construct or destruct safely and/or dependencies of other items.

To use, simply do:

static FXProcess_StaticInit<class> name("text name");
FXPROCESS_STATICDEP(name, <other text name>); // As many times as needed
For example:
static FXProcess_StaticInit<MyDatabase> thedatabase("The Database");
FXPROCESS_STATICDEP(thedatabase, "The File System");

Public Member Functions

 FXProcess_StaticInit (const char *name)
bool create (int &argc, char **argv, FXStream &txtout)
void destroy ()
 operator type * ()
 operator const type * () const
type * operator-> ()
const char * name () const

Protected Attributes

type * object
bool done
void * dependencies

The documentation for this class was generated from the following file:

(C) 2002-2008 Niall Douglas. Some parts (C) to assorted authors.
Generated on Fri Jun 13 22:10:02 2008 for TnFOX by doxygen v1.5.6