#include <module.h>
An InitializationFunctions object is created by the macro MAXON_INITIALIZATION. It is a local entity definition without references or uses which invokes initialization and shutdown functions as part of the initialization and shutdown of the current translation unit. The identifier is given by the source file name and needn't be unique. There may be several InitializationFunctions objects per source file.
Public Member Functions | |
InitializationFunctions (const Char *file, Result< void >(*init)(), void(*free)(), TranslationUnit *unit) | |
Private Attributes | |
EntityDefinition | _super |
Result< void >(*const | _init )() |
void(*const | _free )() |
Friends | |
class | maxon::ObjectModel |
InitializationFunctions | ( | const Char * | file, |
Result< void >(*)() | init, | ||
void(*)() | free, | ||
TranslationUnit * | unit | ||
) |
Constructs the InitializationFunctions object and adds it to the definition list of the current translation unit.
[in] | file | Name of the current source file, will be used for the entity identifier. |
[in] | init | Initialization function, may be nullptr. |
[in] | free | Shutdown function, may be nullptr. |
[in] | unit | The translation unit containing the object. |
|
friend |
|
private |
Base definition object.
|
private |
Initialization function.
|
private |
Shutdown function.