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

util to export global variable More...

Go to the source code of this file.

Macros

#define ZFEXPORT_VAR_DECLARE(ZFLIB_, Type, Name)
 util to export global variable
 
#define ZFEXPORT_VAR_DEFINE(Type, Name, initValue)
 see ZFEXPORT_VAR_DECLARE
 
#define ZFEXPORT_VAR_ALIAS_DECLARE(ZFLIB_, Type, Name, AliasName)
 see ZFEXPORT_VAR_DECLARE
 
#define ZFEXPORT_VAR_ALIAS_DEFINE(Type, Name)
 see ZFEXPORT_VAR_DECLARE
 
#define ZFEXPORT_VAR_VALUEREF_DECLARE(ZFLIB_, Type, Name, ValueRef)
 see ZFEXPORT_VAR_DECLARE
 
#define ZFEXPORT_VAR_VALUEREF_DEFINE(Type, Name)
 see ZFEXPORT_VAR_DECLARE
 
#define ZFEXPORT_VAR_READONLY_DECLARE(ZFLIB_, Type, Name)
 see ZFEXPORT_VAR_DECLARE
 
#define ZFEXPORT_VAR_READONLY_DEFINE(Type, Name, initValue)
 see ZFEXPORT_VAR_DECLARE
 
#define ZFEXPORT_VAR_READONLY_ALIAS_DECLARE(ZFLIB_, Type, Name, AliasName)
 see ZFEXPORT_VAR_DECLARE
 
#define ZFEXPORT_VAR_READONLY_ALIAS_DEFINE(Type, Name)
 see ZFEXPORT_VAR_DECLARE
 
#define ZFEXPORT_VAR_READONLY_VALUEREF_DECLARE(ZFLIB_, Type, Name, ValueRef)
 see ZFEXPORT_VAR_DECLARE
 
#define ZFEXPORT_VAR_READONLY_VALUEREF_DEFINE(Type, Name)
 see ZFEXPORT_VAR_DECLARE
 
#define ZFEXPORT_VAR_USER_REGISTER(Type, Name)
 see ZFEXPORT_VAR_DECLARE
 
#define ZFEXPORT_VAR_READONLY_USER_REGISTER(Type, Name)
 see ZFEXPORT_VAR_DECLARE
 
#define ZFEXPORT_VAR_USER_REGISTER_FOR_FUNC(Type, Name)
 see ZFEXPORT_VAR_DECLARE
 
#define ZFEXPORT_VAR_READONLY_USER_REGISTER_FOR_FUNC(Type, Name)
 see ZFEXPORT_VAR_DECLARE
 
#define ZFEXPORT_RAW_ENUM_DEFINE(EnumName, enumValues, ...)
 util macro to export raw enum
 

Detailed Description

util to export global variable

Macro Definition Documentation

◆ ZFEXPORT_VAR_DECLARE

#define ZFEXPORT_VAR_DECLARE ( ZFLIB_,
Type,
Name )

util to export global variable

the variable are exported as ZFMETHOD_FUNC_DECLARE_0
usage:

// in header file
ZFEXPORT_VAR_DECLARE(ZFLIB_APP, YourType, yourName)
// in source file
ZFEXPORT_VAR_DEFINE(YourType, yourName, yourInitValue)
// access
YourType &v = yourName();
// modify
yourName(v);
#define ZFLIB_APP
used to export symbols
Definition ZFCoreEnvDef.h:35
#define ZFEXPORT_VAR_DECLARE(ZFLIB_, Type, Name)
util to export global variable
Definition ZFExport.h:68
#define ZFEXPORT_VAR_DEFINE(Type, Name, initValue)
see ZFEXPORT_VAR_DECLARE
Definition ZFExport.h:81


for readonly var, use ZFEXPORT_VAR_READONLY_DECLARE
to alias existing var, use ZFEXPORT_VAR_ALIAS_DECLARE
for existing raw var, use ZFEXPORT_VAR_VALUEREF_DECLARE

◆ ZFEXPORT_RAW_ENUM_DEFINE

#define ZFEXPORT_RAW_ENUM_DEFINE ( EnumName,
enumValues,
... )

util macro to export raw enum

for normal enum, use ZFENUM_BEGIN is recommended
this macro is used to export low level enum values by ZFMETHOD_FUNC_USER_REGISTER_0, with this proto type:

YourEnumType YourRawEnumValueName(void);