ZFFramework
 
Loading...
Searching...
No Matches
ZFThread_zfasyncIO.h
Go to the documentation of this file.
1
5
6#ifndef _ZFI_ZFThread_zfasyncIO_h_
7#define _ZFI_ZFThread_zfasyncIO_h_
8
9#include "ZFThreadPool.h"
11
35 , ZFMP_IN(const ZFListener &, callback)
36 , ZFMP_IN_OPT(const ZFListener &, finishCallback, zfnull)
37 )
38
39
42zfclass ZFAsyncIOResumable : zfextend ZFObject, zfimplement ZFSerializable {
43 ZFOBJECT_DECLARE(ZFAsyncIOResumable, ZFObject)
44 ZFIMPLEMENT_DECLARE(ZFSerializable)
45
46public:
50 ZFPROPERTY_ASSIGN(zfindex, totalSize)
51 ZFPROPERTY_ASSIGN(zfindex, blockSize)
52 ZFPROPERTY_RETAIN(zfany, successBlocks)
54
55
57};
58
89 , ZFMP_IN(ZF_IN const ZFOutput &, output)
90 , ZFMP_IN(ZF_IN const ZFInput &, input)
91 , ZFMP_IN_OPT(const ZFListener &, finishCallback, zfnull)
92 , ZFMP_IN_OPT(const ZFListener &, progressCallback, zfnull)
93 , ZFMP_IN_OPT(ZFAsyncIOResumable *, resumable, zfnull)
94 )
95
96// ============================================================
100zfclass ZFLIB_ZFCore ZFThreadPoolForIO : zfextend ZFThreadPool {
101 ZFOBJECT_DECLARE(ZFThreadPoolForIO, ZFThreadPool)
103
109};
110
112#endif // #ifndef _ZFI_ZFThread_zfasyncIO_h_
113
#define ZFLIB_ZFCore
used to export symbols
Definition ZFCoreEnvDef.h:30
#define zfextend
dummy macro shows class inherit from another
Definition ZFCoreTypeDef_ClassType.h:53
#define ZF_IN
dummy macro that shows the param used as required input
Definition ZFCoreTypeDef_ClassType.h:184
_ZFT_t_zfindex zfindex
similar to size_t, used for index and size only
Definition ZFCoreTypeDef_CoreType.h:154
#define zfnull
same as NULL, defined for future use
Definition ZFCoreTypeDef_CoreType.h:88
zft_zfstring< zfchar > zfstring
see zft_zfstring
Definition ZFCoreTypeDef_StringType.h:15
#define ZFMP_IN_OPT(ParamType, paramName, DefaultValue)
see ZFMP_IN
Definition ZFMethod.h:108
#define ZFMP_IN(ParamType, paramName)
macro to wrap param types for ZFMETHOD_INLINE_0 series
Definition ZFMethod.h:105
#define ZFMETHOD_DECLARE_0(ReturnType, MethodName)
see ZFMethod
Definition ZFMethodDeclare.h:693
#define ZFMETHOD_FUNC_DECLARE_5(ZFLIB_, ReturnType, MethodName, ZFMP_0, ZFMP_1, ZFMP_2, ZFMP_3, ZFMP_4)
see ZFMETHOD_FUNC_DECLARE_0
Definition ZFMethodFuncDeclare.h:1228
#define ZFMETHOD_FUNC_DECLARE_2(ZFLIB_, ReturnType, MethodName, ZFMP_0, ZFMP_1)
see ZFMETHOD_FUNC_DECLARE_0
Definition ZFMethodFuncDeclare.h:763
#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
#define ZFOBJECT_SINGLETON_DECLARE(AccessTypeName, accessMethodName)
util macro to declare a singleton instance access for ZFObject type
Definition ZFObjectGlobalInstance.h:256
#define ZFIMPLEMENT_DECLARE(ImplementedInterfaces,...)
see ZFINTERFACE_DECLARE
Definition ZFObjectInterface.h:169
#define zfimplement
shows class implement from interface, see ZFInterface
Definition ZFObjectInterface.h:24
#define ZFPROPERTY_RETAIN(Type, Name,...)
declare a retain property
Definition ZFPropertyDeclare.h:103
#define ZFPROPERTY_ASSIGN(Type, Name,...)
see ZFPROPERTY_RETAIN
Definition ZFPropertyDeclare.h:127
zfautoT< ZFTaskId > zfasyncIO(const ZFOutput &output, const ZFInput &input, const ZFListener &finishCallback=(zft_zfnull), const ZFListener &progressCallback=(zft_zfnull), ZFAsyncIOResumable *resumable=(zft_zfnull))
util to perform IO in ZFThreadPoolForIO
zfautoT< ZFTaskId > zfasyncIOCustom(const ZFListener &callback, const ZFListener &finishCallback=(zft_zfnull))
util to perform IO in ZFThreadPoolForIO
thread utility
virtual void reset()
reset state
general input callback
Definition ZFIOCallback_input.h:36
listener as ZFCallback, mostly used by ZFObject::observerNotify
Definition ZFObjectObserver.h:30
general output callback
Definition ZFIOCallback_output.h:37
abstract task id
Definition ZFTaskId.h:16
virtual zfindex & blockSize()
when input size greater than this, try to split task to different thread
Definition ZFThread_zfasyncIO.h:108
static ZFThreadPoolForIO * instance()
util method to cast ZFObject types freely
Definition zfany.h:35
type restrict version of zfauto
Definition zfautoFwd.h:108