ZFFramework
Loading...
Searching...
No Matches
Macros
ZFListenerDeclare.h File Reference

util macros to declare ZFListener as ZFCallback More...

#include "ZFCallback_lambda.h"

Go to the source code of this file.

Macros

#define ZFLISTENER_END()
 see ZFLISTENER
 
#define ZFLISTENER(name)
 util to declare a ZFListener locally
 
#define ZFLISTENER_0(name)
 see ZFLISTENER
 
#define ZFLISTENER_1(name, CaptureParam0, capture0)
 see ZFLISTENER
 
#define ZFLISTENER_2(name, CaptureParam0, capture0, CaptureParam1, capture1)
 see ZFLISTENER
 
#define ZFLISTENER_3(name, CaptureParam0, capture0, CaptureParam1, capture1, CaptureParam2, capture2)
 see ZFLISTENER
 
#define ZFLISTENER_4(name, CaptureParam0, capture0, CaptureParam1, capture1, CaptureParam2, capture2, CaptureParam3, capture3)
 see ZFLISTENER
 
#define ZFLISTENER_5(name, CaptureParam0, capture0, CaptureParam1, capture1, CaptureParam2, capture2, CaptureParam3, capture3, CaptureParam4, capture4)
 see ZFLISTENER
 
#define ZFLISTENER_6(name, CaptureParam0, capture0, CaptureParam1, capture1, CaptureParam2, capture2, CaptureParam3, capture3, CaptureParam4, capture4, CaptureParam5, capture5)
 see ZFLISTENER
 
#define ZFLISTENER_7(name, CaptureParam0, capture0, CaptureParam1, capture1, CaptureParam2, capture2, CaptureParam3, capture3, CaptureParam4, capture4, CaptureParam5, capture5, CaptureParam6, capture6)
 see ZFLISTENER
 
#define ZFLISTENER_8(name, CaptureParam0, capture0, CaptureParam1, capture1, CaptureParam2, capture2, CaptureParam3, capture3, CaptureParam4, capture4, CaptureParam5, capture5, CaptureParam6, capture6, CaptureParam7, capture7)
 see ZFLISTENER
 

Detailed Description

util macros to declare ZFListener as ZFCallback

Macro Definition Documentation

◆ ZFLISTENER

#define ZFLISTENER ( name)

util to declare a ZFListener locally

usage:

// proto type:
// void listenerName(ZF_IN const ZFArgs &zfargs);
ZFLISTENER(yourListener) {
// your code
obj->observerAdd(eventId, yourListener);
#define ZFLISTENER(name)
util to declare a ZFListener locally
Definition ZFListenerDeclare.h:53
#define ZFLISTENER_END()
see ZFLISTENER
Definition ZFListenerDeclare.h:17

you may also capture params outside of scope, see ZFLAMBDA for more info

zfstring text0 = "text0";
zfstring text1 = "text1";
// proto type:
// void listenerName(ZF_IN const ZFArgs &zfargs);
ZFLISTENER_2(yourListener
, zfstring, text0
, zfstring &, text1
) {
// your code
text0 = "text_0";
text1 = "text_1";
zfLogTrim() << text0 << " " << text1;
yourListener.execute();
zfLogTrim() << text0 << " " << text1;
#define ZFLISTENER_2(name, CaptureParam0, capture0, CaptureParam1, capture1)
see ZFLISTENER
Definition ZFListenerDeclare.h:79
#define zfLogTrim(...)
see zfLog
Definition ZFLog.h:67