6#ifndef _ZFI_ZFProtocolZFThread_h_
7#define _ZFI_ZFProtocolZFThread_h_
57 ZF_IN void *sleepToken
146typedef void *(*ZFMainThreadTaskImplCallbackExecute)(
ZF_IN const ZFListener &runnable);
#define ZFLIB_ZFCore
used to export symbols
Definition ZFCoreEnvDef.h:30
#define ZFCoreLogTrim(format,...)
log without header info, see ZFCoreLog
Definition ZFCoreLog.h:80
#define zfextend
dummy macro shows class inherit from another
Definition ZFCoreTypeDef_ClassType.h:53
#define zfpurevirtual
dummy macro shows that a method is pure virtual method
Definition ZFCoreTypeDef_ClassType.h:68
#define zfoverride
dummy macro shows that method override parent's method
Definition ZFCoreTypeDef_ClassType.h:58
#define ZF_IN
dummy macro that shows the param used as required input
Definition ZFCoreTypeDef_ClassType.h:180
#define ZF_IN_OPT
dummy macro that shows the param used as optional input
Definition ZFCoreTypeDef_ClassType.h:184
_ZFT_t_zfbool zfbool
bool type
Definition ZFCoreTypeDef_CoreType.h:103
#define zftrue
bool true type
Definition ZFCoreTypeDef_CoreType.h:107
_zft_zftimet zftimet
time unit, ensured at least 64 bit, ensured signed
Definition ZFCoreTypeDef_CoreType.h:203
#define zffalse
bool false type
Definition ZFCoreTypeDef_CoreType.h:111
#define zfnull
same as NULL, defined for future use
Definition ZFCoreTypeDef_CoreType.h:88
#define ZF_NAMESPACE_GLOBAL_BEGIN
begin namespace ZFFramework
Definition ZFNamespace.h:97
#define ZF_NAMESPACE_GLOBAL_END
end namespace ZFFramework
Definition ZFNamespace.h:98
#define zfclass
same as class, shows that this class is a ZFObject type
Definition ZFObjectClassTypeFwd.h:38
#define ZFOBJECT_DECLARE(ChildClass, SuperClass,...)
necessary for every class inherit from ZFObject
Definition ZFObjectDeclare.h:126
protocol definitions for ZFFramework
#define ZFPROTOCOL_INTERFACE_END(ModuleName)
for more information, please refer to ZFPROTOCOL_INTERFACE_BEGIN
Definition ZFProtocol.h:414
#define ZFPROTOCOL_INTERFACE_BEGIN(ZFLIB_, ModuleName)
declare a protocol interface for ZFFramework
Definition ZFProtocol.h:408
void ZFMainThreadTaskImplSet(ZFMainThreadTaskImplCallbackExecute executeImpl, ZFMainThreadTaskImplCallbackCleanup cleanupImpl=zft_zfnull)
set custom impl for ZFThread::taskQueueAdd for main thread
ZFMainThreadTaskImplCallbackCleanup ZFMainThreadTaskImplGetCleanup(void)
see ZFMainThreadTaskImplSet
void(* ZFMainThreadTaskImplCallbackCleanup)(void *nativeToken)
see ZFMainThreadTaskImplSet
Definition ZFProtocolZFThread.h:148
void *(* ZFMainThreadTaskImplCallbackExecute)(const ZFListener &runnable)
see ZFMainThreadTaskImplSet
Definition ZFProtocolZFThread.h:146
ZFMainThreadTaskImplCallbackExecute ZFMainThreadTaskImplGetExecute(void)
see ZFMainThreadTaskImplSet
listener as ZFCallback, mostly used by ZFObject::observerNotify
Definition ZFObjectObserver.h:30
virtual ZFThread * threadForToken(void *token)=0
get thread from token created by nativeThreadRegister
virtual void * executeInNewThread(const ZFListener &runnable, const ZFListener &runnableCleanup)=0
run the runnable in new thread
virtual zfbool sleep(void *sleepToken, zftimet miliSecs)
see ZFThread::sleep
virtual void sleepTokenDestroy(void *sleepToken)
see ZFThread::sleep
virtual void sleepCancel(void *sleepToken)
see ZFThread::sleep
virtual void * executeInMainThread(const ZFListener &runnable)=0
run the runnable in main thread
virtual ZFThread * mainThread(void)=0
see ZFThread::mainThread
virtual ZFThread * currentThread(void)=0
see ZFThread::currentThread
virtual void * sleepTokenCreate(void)
see ZFThread::sleep
virtual void executeInMainThreadCleanup(void *nativeToken)=0
used to cleanup nativeToken
virtual void executeInNewThreadCleanup(void *nativeToken)=0
used to cleanup nativeToken
virtual zfbool executeInMainThreadAvailable(void)
whether executeInMainThread available
Definition ZFProtocolZFThread.h:68
virtual void * nativeThreadRegister(ZFThread *ownerZFThread)=0
see ZFThread::nativeThreadUnregister
virtual void nativeThreadUnregister(void *token)=0
see ZFThread::nativeThreadUnregister, nativeThreadRegister
thread utility
Definition ZFThread.h:23
virtual zfbool threadRunning(void)
return true only if thread is running
Definition ZFProtocolZFThread.h:122
virtual zfbool isMainThread(void)
return true if current thread is main thread
Definition ZFProtocolZFThread.h:139
virtual void threadStop(void)
request stop the thread, may not be stopped immediately
Definition ZFProtocolZFThread.h:126
virtual void threadStart(ZFObject *param0=zft_zfnull, ZFObject *param1=zft_zfnull)
start thread, do nothing if already started
Definition ZFProtocolZFThread.h:111
virtual void threadWait(void)
wait until thread finished running
Definition ZFProtocolZFThread.h:130
virtual zfbool threadWait(zftimet miliSecs)
wait until thread finished running, or timeout
Definition ZFProtocolZFThread.h:134
virtual zfbool threadStarted(void)
return true if start is called and hasn't been stopped or end
Definition ZFProtocolZFThread.h:118