InitializationFunctions Class Reference

#include <module.h>

Detailed Description

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
 

Constructor & Destructor Documentation

◆ InitializationFunctions()

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.

Parameters
[in]fileName of the current source file, will be used for the entity identifier.
[in]initInitialization function, may be nullptr.
[in]freeShutdown function, may be nullptr.
[in]unitThe translation unit containing the object.

Friends And Related Function Documentation

◆ maxon::ObjectModel

friend class maxon::ObjectModel
friend

Member Data Documentation

◆ _super

EntityDefinition _super
private

Base definition object.

◆ _init

Result<void>(* const _init) ()
private

Initialization function.

◆ _free

void(* const _free) ()
private

Shutdown function.