FX::FXProcess_StaticInit< type > Class Template Reference

#include <FXProcess.h>

Inheritance diagram for FX::FXProcess_StaticInit< type >:

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");

Definition at line 481 of file FXProcess.h.

Public Member Functions

 FXProcess_StaticInit (const char *name)
 ~FXProcess_StaticInit ()
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-2009 Niall Douglas. Some parts (C) to assorted authors.
Generated on Fri Nov 20 18:35:41 2009 for TnFOX by doxygen v1.4.7