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 ZFTaskIdBasic : zfextend ZFObject, zfimplement ZFTaskId {
27 ZFOBJECT_DECLARE(ZFTaskIdBasic, ZFObject)
28 ZFIMPLEMENT_DECLARE(ZFTaskId)
29public:
31 virtual inline void stopImpl(ZF_IN const ZFListener &v) {
32 _stopImpl = v;
33 }
34
35 virtual inline const ZFListener &stopImpl(void) {
36 return _stopImpl;
37 }
38public:
40 virtual void stop(void) {
41 _stopImpl.execute(ZFArgs().sender(this));
42 }
43protected:
45 virtual inline void objectOnInit(void) {
47 }
48
49 virtual inline void objectOnInit(ZF_IN const ZFListener &stopImpl) {
50 this->stopImpl(stopImpl);
51 }
52private:
53 ZFListener _stopImpl;
54};
55
57#endif // #ifndef _ZFI_ZFTaskId_h_
58
#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:180
#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:45
virtual void objectOnInit(const ZFListener &stopImpl)
init with stopImpl
Definition ZFTaskId.h:49
virtual void stop(void)
stop task
Definition ZFTaskId.h:40
virtual void stopImpl(const ZFListener &v)
for impl to implement ZFTaskId::stop
Definition ZFTaskId.h:31
virtual const ZFListener & stopImpl(void)
see stopImpl
Definition ZFTaskId.h:35
virtual void stop(void)=0
stop task