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

static register util More...

#include "ZFCoreTypeDef.h"

Go to the source code of this file.

Macros

#define ZF_STATIC_REGISTER_INIT(Name)
 static register step that ensured won't be stripped by compiler
 
#define ZF_STATIC_REGISTER_DESTROY(Name)
 see ZF_STATIC_REGISTER_INIT
 
#define ZF_STATIC_REGISTER_END(Name)
 see ZF_STATIC_REGISTER_INIT
 

Detailed Description

static register util

Macro Definition Documentation

◆ ZF_STATIC_REGISTER_INIT

#define ZF_STATIC_REGISTER_INIT ( Name)

static register step that ensured won't be stripped by compiler

usage:

// in cpp files only
// your register code
}
ZF_STATIC_REGISTER_DESTROY(YourName) { // destroy step is optional
// your unregister code
}
#define ZF_STATIC_REGISTER_INIT(Name)
static register step that ensured won't be stripped by compiler
Definition ZFCoreStaticRegister.h:55
#define ZF_STATIC_REGISTER_END(Name)
see ZF_STATIC_REGISTER_INIT
Definition ZFCoreStaticRegister.h:66
#define ZF_STATIC_REGISTER_DESTROY(Name)
see ZF_STATIC_REGISTER_INIT
Definition ZFCoreStaticRegister.h:63
Note
for different register step, the order is not ensured
for internal use only, for app level, use ZF_GLOBAL_INITIALIZER_INIT or ZF_STATIC_INITIALIZER_INIT instead

ADVANCED:
we have these type of initializer: