ZFFramework
 
Loading...
Searching...
No Matches
ZFTaskId.h
Go to the documentation of this file.
1
5
6#ifndef _ZFI_ZFTaskId_h_
7#define _ZFI_ZFTaskId_h_
8
9#include "ZFObjectCore.h"
10
12
16zfinterface ZFLIB_ZFCore ZFTaskId : zfextend ZFInterface {
17 ZFINTERFACE_DECLARE(ZFTaskId, ZFInterface)
18public:
20 virtual void stop(void) zfpurevirtual;
21};
22
26zfclass ZFLIB_ZFCore ZFTaskIdDummy : zfextend ZFObject, zfimplement ZFTaskId {
27 ZFOBJECT_DECLARE(ZFTaskIdDummy, ZFObject)
28 ZFIMPLEMENT_DECLARE(ZFTaskId)
29public:
31 virtual inline void stopped(ZF_IN const zfbool &v) {
32 _stopped = v;
33 }
34
35 virtual inline const zfbool &stopped(void) {
36 return _stopped;
37 }
38public:
40 virtual void stop(void) {
41 _stopped = zftrue;
42 }
43private:
44 zfbool _stopped;
45};
46
50zfclass ZFLIB_ZFCore ZFTaskIdBasic : zfextend ZFObject, zfimplement ZFTaskId {
51 ZFOBJECT_DECLARE(ZFTaskIdBasic, ZFObject)
52 ZFIMPLEMENT_DECLARE(ZFTaskId)
53public:
55 virtual inline void stopImpl(ZF_IN const ZFListener &v) {
56 _stopImpl = v;
57 }
58
59 virtual inline const ZFListener &stopImpl(void) {
60 return _stopImpl;
61 }
62public:
64 virtual void stop(void) {
65 _stopImpl.execute(ZFArgs().sender(this));
66 }
67protected:
69 virtual inline void objectOnInit(void) {
71 }
72
73 virtual inline void objectOnInit(ZF_IN const ZFListener &stopImpl) {
74 this->stopImpl(stopImpl);
75 }
76private:
77 ZFListener _stopImpl;
78};
79
81#endif // #ifndef _ZFI_ZFTaskId_h_
82
#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 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:184
_ZFT_t_zfbool zfbool
bool type
Definition ZFCoreTypeDef_CoreType.h:103
#define zftrue
bool true type
Definition ZFCoreTypeDef_CoreType.h:107
#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
base class of all objects
#define ZFOBJECT_DECLARE(ChildClass, SuperClass,...)
necessary for every class inherit from ZFObject
Definition ZFObjectDeclare.h:126
#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 zfinterface
shows the type is an interface, see ZFInterface
Definition ZFObjectInterface.h:20
#define ZFINTERFACE_DECLARE(InterfaceName, ParentInterface,...)
see ZFInterface
Definition ZFObjectInterface.h:100
listener data used by ZFListener
Definition ZFArgs.h:20
listener as ZFCallback, mostly used by ZFObject::observerNotify
Definition ZFObjectObserver.h:30
virtual void objectOnInit(void)
override this to init your object
virtual void objectOnInit(void)
override this to init your object
Definition ZFTaskId.h:69
virtual void objectOnInit(const ZFListener &stopImpl)
init with stopImpl
Definition ZFTaskId.h:73
virtual void stop(void)
stop task
Definition ZFTaskId.h:64
virtual void stopImpl(const ZFListener &v)
for impl to implement ZFTaskId::stop
Definition ZFTaskId.h:55
virtual const ZFListener & stopImpl(void)
see stopImpl
Definition ZFTaskId.h:59
virtual const zfbool & stopped(void)
see #stopImpl
Definition ZFTaskId.h:35
virtual void stop(void)
stop task
Definition ZFTaskId.h:40
virtual void stopped(const zfbool &v)
for impl to implement ZFTaskId::stop
Definition ZFTaskId.h:31
virtual void stop(void)=0
stop task