ZFFramework
Loading...
Searching...
No Matches
ZFPropertyUserRegister.h
Go to the documentation of this file.
1
5
6#ifndef _ZFI_ZFPropertyUserRegister_h_
7#define _ZFI_ZFPropertyUserRegister_h_
8
10#include "ZFObjectAutoPtr.h"
11#include "ZFNull.h"
13
14// ============================================================
17 ZF_IN ZFObject *ownerObject
18 , ZF_IN const ZFProperty *property
19 , ZF_IN const void *propertyValueOld
20 );
23 ZF_IN ZFObject *ownerObject
24 , ZF_IN const ZFProperty *property
25 );
26
27// ============================================================
28zfclass ZFLIB_ZFCore _ZFP_I_PropUR : zfextend ZFObject {
29 ZFOBJECT_DECLARE(_ZFP_I_PropUR, ZFObject)
30public:
31 typedef void (*DeleteCallback)(ZF_IN void *v);
32 void *v;
33 DeleteCallback deleteCallback;
34 zfauto retainValueHolder;
35public:
36 static zfauto create(
37 ZF_IN void *v
38 , ZF_IN DeleteCallback deleteCallback
39 , ZF_IN_OPT ZFObject *retainValue = zfnull
40 );
41protected:
43 virtual void objectOnDealloc(void) {
44 if(this->v) {
45 this->deleteCallback(this->v);
46 }
47 zfsuper::objectOnDealloc();
48 }
49};
50
52template<typename T_Type>
54private:
55 static void _deleteCallback(ZF_IN void *p) {
56 T_Type *t = (T_Type *)p;
57 zfobjRelease(*t);
58 zfpoolDelete(t);
59 }
60public:
62 static void setterInvoker(
63 ZF_IN const ZFMethod *method
64 , ZF_IN ZFObject *ownerObj
65 , ZF_IN T_Type const &v
66 ) {
68 const ZFProperty *property = method->ownerProperty();
69 if(property == zfnull) {
70 property = method->ownerClass()->propertyForName(method->methodName());
71 }
72 zfstring key = "_ZFP_PropUR_";
73 key += method->methodName();
74 _ZFP_I_PropUR *holder = ownerObj->objectTag(key);
75 zfbool firstTime = (holder == zfnull);
76 zfauto oldValue = holder ? holder->retainValueHolder : zfnull;
77 ownerObj->objectTag(key, _ZFP_I_PropUR::create(
78 zfpoolNew(T_Type, zfobjRetain(v))
79 , _deleteCallback
80 , v ? v->toObject() : zfnull
81 ));
82 ZFPropertyUserRegisterNotifyUpdate(ownerObj, property, firstTime ? zfnull : &oldValue);
83 }
84
85 static T_Type const &getterInvoker(
86 ZF_IN const ZFMethod *method
87 , ZF_IN ZFObject *ownerObj
88 ) {
90 const ZFProperty *property = method->ownerProperty();
91 if(property == zfnull) {
92 property = method->ownerClass()->propertyForName(method->methodName());
93 }
94 zfstring key = "_ZFP_PropUR_";
95 key += method->methodName();
96 _ZFP_I_PropUR *holder = ownerObj->objectTag(key);
97 if(holder == zfnull) {
98 zfauto tmp;
99 if(property->callbackUserRegisterInitValueSetup) {
100 property->callbackUserRegisterInitValueSetup(property, (void *)&tmp);
101 }
102 zfauto holderTmp = _ZFP_I_PropUR::create(
103 zfpoolNew(T_Type, zfobjRetain(tmp))
104 , _deleteCallback
105 , tmp
106 );
107 ownerObj->objectTag(key, holderTmp);
108 holder = holderTmp;
109 ZFPropertyUserRegisterNotifyUpdate(ownerObj, property, zfnull);
110 }
111 return *(T_Type *)holder->v;
112 }
113
115 ZF_IN const ZFProperty *property
116 , ZF_IN zfany const &ownerObj
117 ) {
118 zfstring key = "_ZFP_PropUR_";
119 key += property->propertyName();
120 return (ownerObj->objectTag(key) != zfnull);
121 }
122
124 ZF_IN const ZFProperty *property
125 , ZF_IN zfany const &ownerObj
126 , ZF_OUT_OPT zfauto *outInitValue
127 ) {
129 if(!callbackIsValueAccessed(property, ownerObj)) {
130 return zftrue;
131 }
132 zfauto tmp;
133 if(property->callbackUserRegisterInitValueSetup) {
134 property->callbackUserRegisterInitValueSetup(property, (void *)&tmp);
135 }
136 if(outInitValue != zfnull) {
137 *outInitValue = tmp;
138 }
139 T_Type cur = getterInvoker(property->getterMethod(), ownerObj);
140 T_Type initValueTmp = tmp;
141 if(cur == initValueTmp) {
142 return zftrue;
143 }
144 else if(cur == zfnull || initValueTmp == zfnull) {
145 return zffalse;
146 }
147 else {
148 return (cur->toObject()->objectCompare(initValueTmp->toObject()) == ZFCompareEqual);
149 }
150 }
151
153 ZF_IN const ZFProperty *property
154 , ZF_IN zfany const &ownerObj
155 ) {
157 if(callbackIsValueAccessed(property, ownerObj)) {
158 ZFPropertyUserRegisterNotifyReset(ownerObj, property);
159 }
160 zfstring key = "_ZFP_PropUR_";
161 key += property->propertyName();
162 ownerObj->objectTagRemove(key);
163 }
164};
165
166// ============================================================
168template<typename T_Type>
170private:
171 static void _deleteCallback(ZF_IN void *p) {
172 T_Type *t = (T_Type *)p;
173 zfpoolDelete(t);
174 }
175public:
177 static void setterInvoker(
178 ZF_IN const ZFMethod *method
179 , ZF_IN ZFObject *ownerObj
180 , ZF_IN T_Type const &v
181 ) {
183 const ZFProperty *property = method->ownerProperty();
184 if(property == zfnull) {
185 property = method->ownerClass()->propertyForName(method->methodName());
186 }
187 zfstring key = "_ZFP_PropUR_";
188 key += method->methodName();
189 _ZFP_I_PropUR *holder = ownerObj->objectTag(key);
190 zfbool firstTime = (holder == zfnull);
191 T_Type oldValue = holder ? (*(T_Type *)holder->v) : T_Type();
192 ownerObj->objectTag(key, _ZFP_I_PropUR::create(
193 zfpoolNew(T_Type, v)
194 , _deleteCallback
195 ));
196 ZFPropertyUserRegisterNotifyUpdate(ownerObj, property, firstTime ? zfnull : &oldValue);
197 }
198
199 static T_Type const &getterInvoker(
200 ZF_IN const ZFMethod *method
201 , ZF_IN ZFObject *ownerObj
202 ) {
204 const ZFProperty *property = method->ownerProperty();
205 if(property == zfnull) {
206 property = method->ownerClass()->propertyForName(method->methodName());
207 }
208 zfstring key = "_ZFP_PropUR_";
209 key += method->methodName();
210 _ZFP_I_PropUR *holder = ownerObj->objectTag(key);
211 if(holder == zfnull) {
212 T_Type tmp = T_Type();
213 if(property->callbackUserRegisterInitValueSetup) {
214 property->callbackUserRegisterInitValueSetup(property, (void *)&tmp);
215 }
216 zfauto holderTmp = _ZFP_I_PropUR::create(
217 zfpoolNew(T_Type, tmp)
218 , _deleteCallback
219 );
220 ownerObj->objectTag(key, holderTmp);
221 holder = holderTmp;
222 ZFPropertyUserRegisterNotifyUpdate(ownerObj, property, zfnull);
223 }
224 return *(T_Type *)holder->v;
225 }
226
228 ZF_IN const ZFProperty *property
229 , ZF_IN zfany const &ownerObj
230 ) {
231 zfstring key = "_ZFP_PropUR_";
232 key += property->propertyName();
233 return (ownerObj->objectTag(key) != zfnull);
234 }
235
237 ZF_IN const ZFProperty *property
238 , ZF_IN zfany const &ownerObj
239 , ZF_OUT_OPT zfauto *outInitValue
240 ) {
242 if(!callbackIsValueAccessed(property, ownerObj)) {
243 return zftrue;
244 }
245 T_Type tmp = T_Type();
246 if(property->callbackUserRegisterInitValueSetup) {
247 property->callbackUserRegisterInitValueSetup(property, (void *)&tmp);
248 }
249 if(outInitValue != zfnull) {
250 ZFTypeId<T_Type>::ValueStore(*outInitValue, tmp);
251 }
252 return (getterInvoker(property->getterMethod(), ownerObj) == tmp);
253 }
254
256 ZF_IN const ZFProperty *property
257 , ZF_IN zfany const &ownerObj
258 ) {
260 if(callbackIsValueAccessed(property, ownerObj)) {
261 ZFPropertyUserRegisterNotifyReset(ownerObj, property);
262 }
263 zfstring key = "_ZFP_PropUR_";
264 key += property->propertyName();
265 ownerObj->objectTagRemove(key);
266 }
267};
268
269// ============================================================
270#define _ZFP_ZFPropertyUserRegister_PropInit_Retain(registerSig, Type, InitValueOrEmpty) \
271 zfclassNotPOD _ZFP_PropURInit_##registerSig { \
272 public: \
273 static void I( \
274 ZF_IN const ZFProperty *property \
275 , ZF_IN_OUT void *p \
276 ) { \
277 *(zfauto *)p = zfauto(InitValueOrEmpty); \
278 } \
279 };
280#define _ZFP_ZFPropertyUserRegister_PropInit_Assign(registerSig, Type, InitValueOrEmpty) \
281 zfclassNotPOD _ZFP_PropURInit_##registerSig { \
282 public: \
283 static void I( \
284 ZF_IN const ZFProperty *property \
285 , ZF_IN_OUT void *p \
286 ) { \
287 typedef Type T_Type; \
288 T_Type *valueTmp = zfpoolNew(T_Type, InitValueOrEmpty); \
289 *(T_Type *)p = *valueTmp; \
290 zfpoolDelete(valueTmp); \
291 } \
292 };
293
294#define _ZFP_ZFPropertyUserRegister_ParamExpand_Retain( \
295 registerSig, \
296 ownerClass, \
297 Type, propertyNameString, \
298 ZFTypeId_noneOrType, \
299 setterMethod, getterMethod, \
300 propertyClassOfRetainProperty \
301 , Func_ZFPropertyCallbackIsValueAccessed \
302 , Func_ZFPropertyCallbackIsInitValue \
303 , Func_ZFPropertyCallbackValueReset \
304 ) \
305 ( \
306 zftrue \
307 , zffalse \
308 , zftrue \
309 , zftrue \
310 , zfnull \
311 , ownerClass \
312 , propertyNameString \
313 , zftext(#Type) \
314 , ZFTypeId_noneOrType \
315 , setterMethod \
316 , getterMethod \
317 , propertyClassOfRetainProperty \
318 , Func_ZFPropertyCallbackIsValueAccessed \
319 , Func_ZFPropertyCallbackIsInitValue \
320 , Func_ZFPropertyCallbackValueReset \
321 , _ZFP_PropURInit_##registerSig::I \
322 , zfnull \
323 , zfnull \
324 , zfnull \
325 );
326#define _ZFP_ZFPropertyUserRegister_ParamExpand_Assign( \
327 registerSig, \
328 ownerClass, \
329 Type, propertyNameString, \
330 ZFTypeId_noneOrType, \
331 setterMethod, \
332 getterMethod, \
333 propertyClassOfRetainProperty \
334 , Func_ZFPropertyCallbackIsValueAccessed \
335 , Func_ZFPropertyCallbackIsInitValue \
336 , Func_ZFPropertyCallbackValueReset \
337 ) \
338 ( \
339 zftrue \
340 , zffalse \
341 , zftrue \
342 , zftrue \
343 , zfnull \
344 , ownerClass \
345 , propertyNameString \
346 , zftext(#Type) \
347 , ZFTypeId_noneOrType \
348 , setterMethod \
349 , getterMethod \
350 , propertyClassOfRetainProperty \
351 , Func_ZFPropertyCallbackIsValueAccessed \
352 , Func_ZFPropertyCallbackIsInitValue \
353 , Func_ZFPropertyCallbackValueReset \
354 , _ZFP_PropURInit_##registerSig::I \
355 , zfnull \
356 , zfnull \
357 , zfnull \
358 )
359
360// ============================================================
361#define _ZFP_ZFPropertyUserRegister(resultProperty, ownerClass, \
362 Type, propertyNameString, InitValueOrEmpty, \
363 SetterAccessType, GetterAccessType, \
364 RetainOrAssign, \
365 ZFTypeId_noneOrType, \
366 propertyClassOfRetainProperty \
367 , Func_ZFPropertySetterInvoker \
368 , Func_ZFPropertyGetterInvoker \
369 , Func_ZFPropertyCallbackIsValueAccessed \
370 , Func_ZFPropertyCallbackIsInitValue \
371 , Func_ZFPropertyCallbackValueReset \
372 ) \
373 const ZFProperty *resultProperty = zfnull; \
374 { \
375 ZFCoreMutexLocker(); \
376 const ZFClass *_ownerClass = ownerClass; \
377 zfstring _propertyName(propertyNameString); \
378 \
379 ZFMethodUserRegisterDetail_1(setterMethod, { \
380 Func_ZFPropertySetterInvoker(invokerMethod, invokerObject, value); \
381 }, _ownerClass, SetterAccessType, ZFMethodTypeVirtual, \
382 void, _propertyName, \
383 ZFMP_IN(Type const &, value)); \
384 ZFMethodUserRegisterDetail_0(getterMethod, { \
385 return Func_ZFPropertyGetterInvoker(invokerMethod, invokerObject); \
386 }, _ownerClass, GetterAccessType, ZFMethodTypeVirtual, \
387 Type const &, _propertyName); \
388 _ZFP_ZFPropertyUserRegister_PropInit_##RetainOrAssign(_, Type, InitValueOrEmpty) \
389 resultProperty = ZFProperty::_ZFP_ZFPropertyRegister _ZFP_ZFPropertyUserRegister_ParamExpand_##RetainOrAssign( \
390 _, _ownerClass, \
391 Type, _propertyName, \
392 ZFTypeId_noneOrType, \
393 setterMethod, getterMethod, \
394 propertyClassOfRetainProperty \
395 , Func_ZFPropertyCallbackIsValueAccessed \
396 , Func_ZFPropertyCallbackIsInitValue \
397 , Func_ZFPropertyCallbackValueReset \
398 ); \
399 } \
400 ZFUNUSED(resultProperty)
401
402#define _ZFP_ZFPROPERTY_USER_REGISTER(ownerClassSig, \
403 Type, propertyNameSig, InitValueOrEmpty, \
404 SetterAccessType, GetterAccessType, \
405 RetainOrAssign, \
406 ZFTypeId_noneOrType, \
407 propertyClassOfRetainProperty \
408 , Func_ZFPropertySetterInvoker \
409 , Func_ZFPropertyGetterInvoker \
410 , Func_ZFPropertyCallbackIsValueAccessed \
411 , Func_ZFPropertyCallbackIsInitValue \
412 , Func_ZFPropertyCallbackValueReset \
413 ) \
414 zfclassNotPOD _ZFP_PropURMH_##ownerClassSig##_##propertyNameSig { \
415 public: \
416 static const ZFMethod *S(void) { \
417 ZFMethodUserRegisterDetail_1(setterMethod, { \
418 Func_ZFPropertySetterInvoker(invokerMethod, invokerObject, value); \
419 }, ownerClassSig::ClassData(), SetterAccessType, ZFMethodTypeVirtual, \
420 void, zftext(#propertyNameSig), \
421 ZFMP_IN(Type const &, value)); \
422 return setterMethod; \
423 } \
424 static const ZFMethod *G(void) { \
425 ZFMethodUserRegisterDetail_0(getterMethod, { \
426 return Func_ZFPropertyGetterInvoker(invokerMethod, invokerObject); \
427 }, ownerClassSig::ClassData(), GetterAccessType, ZFMethodTypeVirtual, \
428 Type const &, zftext(#propertyNameSig)); \
429 return getterMethod; \
430 } \
431 }; \
432 _ZFP_ZFPropertyUserRegister_PropInit_##RetainOrAssign(ownerClassSig##_##propertyNameSig, Type, InitValueOrEmpty) \
433 static _ZFP_ZFPropertyRegisterHolder _ZFP_PropURH_##ownerClassSig##_##propertyNameSig \
434 _ZFP_ZFPropertyUserRegister_ParamExpand_##RetainOrAssign( \
435 ownerClassSig##_##propertyNameSig, ownerClassSig::ClassData(), \
436 Type, zftext(#propertyNameSig), \
437 ZFTypeId_noneOrType, \
438 _ZFP_PropURMH_##ownerClassSig##_##propertyNameSig::S(), \
439 _ZFP_PropURMH_##ownerClassSig##_##propertyNameSig::G(), \
440 propertyClassOfRetainProperty \
441 , Func_ZFPropertyCallbackIsValueAccessed \
442 , Func_ZFPropertyCallbackIsInitValue \
443 , Func_ZFPropertyCallbackValueReset \
444 );
445
446// ============================================================
545#define ZFPropertyUserRegisterRetain(resultProperty, ownerClass, \
546 Type, propertyNameString, InitValueOrEmpty, \
547 SetterAccessType, GetterAccessType \
548 ) \
549 ZFPropertyUserRegisterRetainDetail(resultProperty, ownerClass, \
550 Type, propertyNameString, InitValueOrEmpty, \
551 SetterAccessType, GetterAccessType \
552 , ZFPropertyUserRegisterDefaultImplRetain<Type>::setterInvoker \
553 , ZFPropertyUserRegisterDefaultImplRetain<Type>::getterInvoker \
554 , ZFPropertyUserRegisterDefaultImplRetain<Type>::callbackIsValueAccessed \
555 , ZFPropertyUserRegisterDefaultImplRetain<Type>::callbackIsInitValue \
556 , ZFPropertyUserRegisterDefaultImplRetain<Type>::callbackValueReset \
557 )
559#define ZFPropertyUserRegisterRetainDetail(resultProperty, ownerClass, \
560 Type, propertyNameString, InitValueOrEmpty, \
561 SetterAccessType, GetterAccessType \
562 , Func_ZFPropertySetterInvoker \
563 , Func_ZFPropertyGetterInvoker \
564 , Func_ZFPropertyCallbackIsValueAccessed \
565 , Func_ZFPropertyCallbackIsInitValue \
566 , Func_ZFPropertyCallbackValueReset \
567 ) \
568 _ZFP_ZFPropertyUserRegister(resultProperty, ownerClass, \
569 Type, propertyNameString, InitValueOrEmpty, \
570 SetterAccessType, GetterAccessType, \
571 Retain, \
572 zftTraits<Type>::TrType::ClassData()->classNameFull(), \
573 zftTraits<Type>::TrType::ClassData() \
574 , Func_ZFPropertySetterInvoker \
575 , Func_ZFPropertyGetterInvoker \
576 , Func_ZFPropertyCallbackIsValueAccessed \
577 , Func_ZFPropertyCallbackIsInitValue \
578 , Func_ZFPropertyCallbackValueReset \
579 )
581#define ZFPROPERTY_USER_REGISTER_RETAIN(ownerClassSig, \
582 Type, propertyNameSig, InitValueOrEmpty, \
583 SetterAccessType, GetterAccessType \
584 ) \
585 ZFPROPERTY_USER_REGISTER_RETAIN_DETAIL(ownerClassSig, \
586 Type, propertyNameSig, InitValueOrEmpty, \
587 SetterAccessType, GetterAccessType \
588 , ZFPropertyUserRegisterDefaultImplRetain<Type>::setterInvoker \
589 , ZFPropertyUserRegisterDefaultImplRetain<Type>::getterInvoker \
590 , ZFPropertyUserRegisterDefaultImplRetain<Type>::callbackIsValueAccessed \
591 , ZFPropertyUserRegisterDefaultImplRetain<Type>::callbackIsInitValue \
592 , ZFPropertyUserRegisterDefaultImplRetain<Type>::callbackValueReset \
593 )
595#define ZFPROPERTY_USER_REGISTER_RETAIN_DETAIL(ownerClassSig, \
596 Type, propertyNameSig, InitValueOrEmpty, \
597 SetterAccessType, GetterAccessType \
598 , Func_ZFPropertySetterInvoker \
599 , Func_ZFPropertyGetterInvoker \
600 , Func_ZFPropertyCallbackIsValueAccessed \
601 , Func_ZFPropertyCallbackIsInitValue \
602 , Func_ZFPropertyCallbackValueReset \
603 ) \
604 _ZFP_ZFPROPERTY_USER_REGISTER(ownerClassSig, \
605 Type, propertyNameSig, InitValueOrEmpty, \
606 SetterAccessType, GetterAccessType, \
607 Retain, \
608 zftTraits<Type>::TrType::ClassData()->classNameFull(), \
609 zftTraits<Type>::TrType::ClassData() \
610 , Func_ZFPropertySetterInvoker \
611 , Func_ZFPropertyGetterInvoker \
612 , Func_ZFPropertyCallbackIsValueAccessed \
613 , Func_ZFPropertyCallbackIsInitValue \
614 , Func_ZFPropertyCallbackValueReset \
615 )
616
617// ============================================================
619#define ZFPropertyUserRegisterAssign(resultProperty, ownerClass, \
620 Type, propertyNameString, InitValueOrEmpty, \
621 SetterAccessType, GetterAccessType \
622 ) \
623 ZFPropertyUserRegisterAssignDetail(resultProperty, ownerClass, \
624 Type, propertyNameString, InitValueOrEmpty, \
625 SetterAccessType, GetterAccessType \
626 , ZFPropertyUserRegisterDefaultImplAssign<Type>::setterInvoker \
627 , ZFPropertyUserRegisterDefaultImplAssign<Type>::getterInvoker \
628 , ZFPropertyUserRegisterDefaultImplAssign<Type>::callbackIsValueAccessed \
629 , ZFPropertyUserRegisterDefaultImplAssign<Type>::callbackIsInitValue \
630 , ZFPropertyUserRegisterDefaultImplAssign<Type>::callbackValueReset \
631 )
633#define ZFPropertyUserRegisterAssignDetail(resultProperty, ownerClass, \
634 Type, propertyNameString, InitValueOrEmpty, \
635 SetterAccessType, GetterAccessType \
636 , Func_ZFPropertySetterInvoker \
637 , Func_ZFPropertyGetterInvoker \
638 , Func_ZFPropertyCallbackIsValueAccessed \
639 , Func_ZFPropertyCallbackIsInitValue \
640 , Func_ZFPropertyCallbackValueReset \
641 ) \
642 _ZFP_ZFPropertyUserRegister(resultProperty, ownerClass, \
643 Type, propertyNameString, InitValueOrEmpty, \
644 SetterAccessType, GetterAccessType, \
645 Assign, \
646 ZFTypeId<zftTraits<Type>::TrNoRef>::TypeId(), \
647 zfnull \
648 , Func_ZFPropertySetterInvoker \
649 , Func_ZFPropertyGetterInvoker \
650 , Func_ZFPropertyCallbackIsValueAccessed \
651 , Func_ZFPropertyCallbackIsInitValue \
652 , Func_ZFPropertyCallbackValueReset \
653 )
655#define ZFPROPERTY_USER_REGISTER_ASSIGN(ownerClassSig, \
656 Type, propertyNameSig, InitValueOrEmpty, \
657 SetterAccessType, GetterAccessType \
658 ) \
659 ZFPROPERTY_USER_REGISTER_ASSIGN_DETAIL(ownerClassSig, \
660 Type, propertyNameSig, InitValueOrEmpty, \
661 SetterAccessType, GetterAccessType \
662 , ZFPropertyUserRegisterDefaultImplAssign<Type>::setterInvoker \
663 , ZFPropertyUserRegisterDefaultImplAssign<Type>::getterInvoker \
664 , ZFPropertyUserRegisterDefaultImplAssign<Type>::callbackIsValueAccessed \
665 , ZFPropertyUserRegisterDefaultImplAssign<Type>::callbackIsInitValue \
666 , ZFPropertyUserRegisterDefaultImplAssign<Type>::callbackValueReset \
667 )
669#define ZFPROPERTY_USER_REGISTER_ASSIGN_DETAIL(ownerClassSig, \
670 Type, propertyNameSig, InitValueOrEmpty, \
671 SetterAccessType, GetterAccessType \
672 , Func_ZFPropertySetterInvoker \
673 , Func_ZFPropertyGetterInvoker \
674 , Func_ZFPropertyCallbackIsValueAccessed \
675 , Func_ZFPropertyCallbackIsInitValue \
676 , Func_ZFPropertyCallbackValueReset \
677 ) \
678 _ZFP_ZFPROPERTY_USER_REGISTER(ownerClassSig, \
679 Type, propertyNameSig, InitValueOrEmpty, \
680 SetterAccessType, GetterAccessType, \
681 Assign, \
682 ZFTypeId<zftTraits<Type>::TrNoRef>::TypeId(), \
683 zfnull \
684 , Func_ZFPropertySetterInvoker \
685 , Func_ZFPropertyGetterInvoker \
686 , Func_ZFPropertyCallbackIsValueAccessed \
687 , Func_ZFPropertyCallbackIsInitValue \
688 , Func_ZFPropertyCallbackValueReset \
689 )
690
691// ============================================================
694
696#endif // #ifndef _ZFI_ZFPropertyUserRegister_h_
697
#define ZFLIB_ZFCore
used to export symbols
Definition ZFCoreEnvDef.h:30
#define ZFCoreMutexLocker()
util method to lock current block
Definition ZFCoreMutex.h:95
#define ZF_OUT_OPT
dummy macro that shows the param used as optional output
Definition ZFCoreTypeDef_ClassType.h:208
#define zfextend
dummy macro shows class inherit from another
Definition ZFCoreTypeDef_ClassType.h:53
#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:196
#define ZF_IN_OPT
dummy macro that shows the param used as optional input
Definition ZFCoreTypeDef_ClassType.h:200
#define zfclassNotPOD
shows the class is not a POD type, you should not memset it or declare it in stack or copy value by c...
Definition ZFCoreTypeDef_ClassType.h:48
_ZFT_t_zfbool zfbool
bool type
Definition ZFCoreTypeDef_CoreType.h:103
#define zftrue
bool true type
Definition ZFCoreTypeDef_CoreType.h:107
#define zffalse
bool false type
Definition ZFCoreTypeDef_CoreType.h:111
#define zfnull
same as NULL, defined for future use
Definition ZFCoreTypeDef_CoreType.h:88
@ ZFCompareEqual
Definition ZFCoreTypeDef_OtherType.h:31
zft_zfstring< zfchar > zfstring
see zft_zfstring
Definition ZFCoreTypeDef_StringType.h:15
#define zfpoolDelete(obj)
see zfnew
Definition ZFMemPool.h:81
#define zfpoolNew(T_Type,...)
see zfnew
Definition ZFMemPool.h:80
user registered ZFMethod
#define ZF_NAMESPACE_GLOBAL_BEGIN
begin namespace ZFFramework
Definition ZFNamespace.h:97
#define ZF_NAMESPACE_GLOBAL_END
end namespace ZFFramework
Definition ZFNamespace.h:98
ZFNull.
smart pointer for ZFObject
#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:122
#define zfobjRetain(obj)
retain an object, see ZFObject
Definition ZFObjectRetain.h:125
#define zfobjRelease(obj)
release an object, see ZFObject
Definition ZFObjectRetain.h:145
void ZFPropertyUserUnregister(const ZFProperty *zfproperty)
see ZFPropertyUserRegisterRetain
void ZFPropertyUserRegisterNotifyReset(ZFObject *ownerObject, const ZFProperty *property)
see ZFPropertyUserRegisterRetain
void ZFPropertyUserRegisterNotifyUpdate(ZFObject *ownerObject, const ZFProperty *property, const void *propertyValueOld)
see ZFPropertyUserRegisterRetain, ZFObject::objectPropertyValueOnUpdate
reflectable method for ZFObject
Definition ZFMethod.h:252
base class of all objects
Definition ZFObjectCore.h:195
info for a property for ZFObject, see ZFPROPERTY_RETAIN for more info
Definition ZFProperty.h:27
default impl for ZFPropertyUserRegisterAssign
Definition ZFPropertyUserRegister.h:169
static void setterInvoker(const ZFMethod *method, ZFObject *ownerObj, T_Type const &v)
default impl for ZFPropertyUserRegisterAssign
Definition ZFPropertyUserRegister.h:177
static zfbool callbackIsInitValue(const ZFProperty *property, zfany const &ownerObj, zfauto *outInitValue)
default impl for ZFPropertyUserRegisterAssign
Definition ZFPropertyUserRegister.h:236
static void callbackValueReset(const ZFProperty *property, zfany const &ownerObj)
default impl for ZFPropertyUserRegisterRetain
Definition ZFPropertyUserRegister.h:255
static T_Type const & getterInvoker(const ZFMethod *method, ZFObject *ownerObj)
default impl for ZFPropertyUserRegisterAssign
Definition ZFPropertyUserRegister.h:199
static zfbool callbackIsValueAccessed(const ZFProperty *property, zfany const &ownerObj)
default impl for ZFPropertyUserRegisterAssign
Definition ZFPropertyUserRegister.h:227
default impl for ZFPropertyUserRegisterRetain
Definition ZFPropertyUserRegister.h:53
static void callbackValueReset(const ZFProperty *property, zfany const &ownerObj)
default impl for ZFPropertyUserRegisterRetain
Definition ZFPropertyUserRegister.h:152
static void setterInvoker(const ZFMethod *method, ZFObject *ownerObj, T_Type const &v)
default impl for ZFPropertyUserRegisterRetain
Definition ZFPropertyUserRegister.h:62
static T_Type const & getterInvoker(const ZFMethod *method, ZFObject *ownerObj)
default impl for ZFPropertyUserRegisterRetain
Definition ZFPropertyUserRegister.h:85
static zfbool callbackIsValueAccessed(const ZFProperty *property, zfany const &ownerObj)
default impl for ZFPropertyUserRegisterRetain
Definition ZFPropertyUserRegister.h:114
static zfbool callbackIsInitValue(const ZFProperty *property, zfany const &ownerObj, zfauto *outInitValue)
default impl for ZFPropertyUserRegisterRetain
Definition ZFPropertyUserRegister.h:123
static zfbool ValueStore(zfauto &obj, T_Type const &v)
store the value to wrapper object
util method to cast ZFObject types freely
Definition zfany.h:35
a ZFObject holder which would release content object automatically when destroyed
Definition zfautoFwd.h:34