ZFFramework
 
Loading...
Searching...
No Matches
ZFCoreStaticInitializer.h File Reference

static initializer step More...

Go to the source code of this file.

Macros

#define ZF_STATIC_INITIALIZER_INIT(Name)
 static initializer
 
#define ZF_STATIC_INITIALIZER_DESTROY(Name)
 see ZF_STATIC_INITIALIZER_INIT
 
#define ZF_STATIC_INITIALIZER_END(Name)
 see ZF_STATIC_INITIALIZER_INIT
 
#define ZF_STATIC_INITIALIZER_INSTANCE(Name)
 access the instance of the initializer
 
#define ZF_STATIC_INITIALIZER_CLASS(Name)
 the class holder of the static initializer
 

Detailed Description

static initializer step

Macro Definition Documentation

◆ ZF_STATIC_INITIALIZER_INIT

#define ZF_STATIC_INITIALIZER_INIT ( Name)

static initializer

called before any other active code, must be used in a cpp file
typical usage:

// in a cpp file only
: privateMember() // you may add member init here
{
// add your own init phase here
// note: never access ZFFramework member here
}
// add your own cleanup phase here
// note: never access ZFFramework member here
}
private:
zfbool privateMember; // you may add member declaration here
void func(void) {} // you may add private function here
#define ZF_STATIC_INITIALIZER_END(Name)
see ZF_STATIC_INITIALIZER_INIT
Definition ZFCoreStaticInitializer.h:87
#define ZF_STATIC_INITIALIZER_DESTROY(Name)
see ZF_STATIC_INITIALIZER_INIT
Definition ZFCoreStaticInitializer.h:82
#define ZF_STATIC_INITIALIZER_INIT(Name)
static initializer
Definition ZFCoreStaticInitializer.h:60
_ZFT_t_zfbool zfbool
bool type
Definition ZFCoreTypeDef_CoreType.h:103


Note
if more than one initializer exists, the order of the initialization is not ensured
use ZF_GLOBAL_INITIALIZER_INIT is recommended at most of case
Warning
you should not access any of ZFFramework members in the static initializer, you may check it by ZFFrameworkStateCheck
Note
see ZF_STATIC_REGISTER_INIT for recommended usage