![]() |
Elm
2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
|
#include <elm/util/Initializer.h>
Public Member Functions | |
| Initializer (bool start=true) | |
| ~Initializer (void) | |
| void | record (T *object) |
| void | startup (void) |
This class is a partial solution to the problem of the initialization order of static variables at the start time of a program in C++. This class solve the following problem at initialization. A set of static object embedded in different sources shares a common datastructure whose initialization time may be happen after some of these objects.
| T | Type of the objects to give an order to. Must contain a method named initialize() that is called to perform the real initialization of the object. |
| Initializer | ( | bool | start = true | ) |
Simple constructor.
| start | If set to true, the initialization takes place at construction else the initialization is delayed until the startup() method call from an external source. |
| ~Initializer | ( | void | ) |
References elm::io::list().
| void record | ( | T * | object | ) |
Record the given object to be initialized after the shared data item.
| object | Object to initialize. |
References elm::io::list().
Cause the initializer to start to initializer recorded objects.
References elm::io::list().