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 zfRelease(*t);
58 zfdelete(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 zfnew(T_Type, zfRetain(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 zfnew(T_Type, zfRetain(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 zfdelete(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 zfnew(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 zfnew(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 , zfnull \
309 , ownerClass \
310 , propertyNameString \
311 , zftext(#Type) \
312 , ZFTypeId_noneOrType \
313 , setterMethod \
314 , getterMethod \
315 , _ZFP_ZFPropertyMethodCleanup_UserReg \
316 , _ZFP_ZFPropertyMethodCleanup_UserReg \
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 , zfnull \
342 , ownerClass \
343 , propertyNameString \
344 , zftext(#Type) \
345 , ZFTypeId_noneOrType \
346 , setterMethod \
347 , getterMethod \
348 , _ZFP_ZFPropertyMethodCleanup_UserReg \
349 , _ZFP_ZFPropertyMethodCleanup_UserReg \
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// ============================================================
361extern ZFLIB_ZFCore void _ZFP_ZFPropertyMethodCleanup_UserReg(ZF_IN const ZFMethod *method);
362#define _ZFP_ZFPropertyUserRegister(resultProperty, ownerClass, \
363 Type, propertyNameString, InitValueOrEmpty, \
364 SetterAccessType, GetterAccessType, \
365 RetainOrAssign, \
366 ZFTypeId_noneOrType, \
367 propertyClassOfRetainProperty \
368 , Func_ZFPropertySetterInvoker \
369 , Func_ZFPropertyGetterInvoker \
370 , Func_ZFPropertyCallbackIsValueAccessed \
371 , Func_ZFPropertyCallbackIsInitValue \
372 , Func_ZFPropertyCallbackValueReset \
373 ) \
374 const ZFProperty *resultProperty = zfnull; \
375 { \
376 ZFCoreMutexLocker(); \
377 const ZFClass *_ownerClass = ownerClass; \
378 zfstring _propertyName(propertyNameString); \
379 \
380 ZFMethodUserRegisterDetail_1(setterMethod, { \
381 Func_ZFPropertySetterInvoker(invokerMethod, invokerObject, value); \
382 }, _ownerClass, SetterAccessType, ZFMethodTypeVirtual, \
383 void, _propertyName, \
384 ZFMP_IN(Type const &, value)); \
385 ZFMethodUserRegisterDetail_0(getterMethod, { \
386 return Func_ZFPropertyGetterInvoker(invokerMethod, invokerObject); \
387 }, _ownerClass, GetterAccessType, ZFMethodTypeVirtual, \
388 Type const &, _propertyName); \
389 _ZFP_ZFPropertyUserRegister_PropInit_##RetainOrAssign(_, Type, InitValueOrEmpty) \
390 resultProperty = _ZFP_ZFPropertyRegister _ZFP_ZFPropertyUserRegister_ParamExpand_##RetainOrAssign( \
391 _, _ownerClass, \
392 Type, _propertyName, \
393 ZFTypeId_noneOrType, \
394 setterMethod, getterMethod, \
395 propertyClassOfRetainProperty \
396 , Func_ZFPropertyCallbackIsValueAccessed \
397 , Func_ZFPropertyCallbackIsInitValue \
398 , Func_ZFPropertyCallbackValueReset \
399 ); \
400 } \
401 ZFUNUSED(resultProperty)
402
403#define _ZFP_ZFPROPERTY_USER_REGISTER(ownerClassSig, \
404 Type, propertyNameSig, InitValueOrEmpty, \
405 SetterAccessType, GetterAccessType, \
406 RetainOrAssign, \
407 ZFTypeId_noneOrType, \
408 propertyClassOfRetainProperty \
409 , Func_ZFPropertySetterInvoker \
410 , Func_ZFPropertyGetterInvoker \
411 , Func_ZFPropertyCallbackIsValueAccessed \
412 , Func_ZFPropertyCallbackIsInitValue \
413 , Func_ZFPropertyCallbackValueReset \
414 ) \
415 zfclassNotPOD _ZFP_PropURMH_##ownerClassSig##_##propertyNameSig { \
416 public: \
417 static const ZFMethod *S(void) { \
418 ZFMethodUserRegisterDetail_1(setterMethod, { \
419 Func_ZFPropertySetterInvoker(invokerMethod, invokerObject, value); \
420 }, ownerClassSig::ClassData(), SetterAccessType, ZFMethodTypeVirtual, \
421 void, zftext(#propertyNameSig), \
422 ZFMP_IN(Type const &, value)); \
423 return setterMethod; \
424 } \
425 static const ZFMethod *G(void) { \
426 ZFMethodUserRegisterDetail_0(getterMethod, { \
427 return Func_ZFPropertyGetterInvoker(invokerMethod, invokerObject); \
428 }, ownerClassSig::ClassData(), GetterAccessType, ZFMethodTypeVirtual, \
429 Type const &, zftext(#propertyNameSig)); \
430 return getterMethod; \
431 } \
432 }; \
433 _ZFP_ZFPropertyUserRegister_PropInit_##RetainOrAssign(ownerClassSig##_##propertyNameSig, Type, InitValueOrEmpty) \
434 static _ZFP_ZFPropertyRegisterHolder _ZFP_PropURH_##ownerClassSig##_##propertyNameSig \
435 _ZFP_ZFPropertyUserRegister_ParamExpand_##RetainOrAssign( \
436 ownerClassSig##_##propertyNameSig, ownerClassSig::ClassData(), \
437 Type, zftext(#propertyNameSig), \
438 ZFTypeId_noneOrType, \
439 _ZFP_PropURMH_##ownerClassSig##_##propertyNameSig::S(), \
440 _ZFP_PropURMH_##ownerClassSig##_##propertyNameSig::G(), \
441 propertyClassOfRetainProperty \
442 , Func_ZFPropertyCallbackIsValueAccessed \
443 , Func_ZFPropertyCallbackIsInitValue \
444 , Func_ZFPropertyCallbackValueReset \
445 );
446
447// ============================================================
546#define ZFPropertyUserRegisterRetain(resultProperty, ownerClass, \
547 Type, propertyNameString, InitValueOrEmpty, \
548 SetterAccessType, GetterAccessType \
549 ) \
550 ZFPropertyUserRegisterRetainDetail(resultProperty, ownerClass, \
551 Type, propertyNameString, InitValueOrEmpty, \
552 SetterAccessType, GetterAccessType \
553 , ZFPropertyUserRegisterDefaultImplRetain<Type>::setterInvoker \
554 , ZFPropertyUserRegisterDefaultImplRetain<Type>::getterInvoker \
555 , ZFPropertyUserRegisterDefaultImplRetain<Type>::callbackIsValueAccessed \
556 , ZFPropertyUserRegisterDefaultImplRetain<Type>::callbackIsInitValue \
557 , ZFPropertyUserRegisterDefaultImplRetain<Type>::callbackValueReset \
558 )
560#define ZFPropertyUserRegisterRetainDetail(resultProperty, ownerClass, \
561 Type, propertyNameString, InitValueOrEmpty, \
562 SetterAccessType, GetterAccessType \
563 , Func_ZFPropertySetterInvoker \
564 , Func_ZFPropertyGetterInvoker \
565 , Func_ZFPropertyCallbackIsValueAccessed \
566 , Func_ZFPropertyCallbackIsInitValue \
567 , Func_ZFPropertyCallbackValueReset \
568 ) \
569 _ZFP_ZFPropertyUserRegister(resultProperty, ownerClass, \
570 Type, propertyNameString, InitValueOrEmpty, \
571 SetterAccessType, GetterAccessType, \
572 Retain, \
573 zftTraits<Type>::TrType::ClassData()->classNameFull(), \
574 zftTraits<Type>::TrType::ClassData() \
575 , Func_ZFPropertySetterInvoker \
576 , Func_ZFPropertyGetterInvoker \
577 , Func_ZFPropertyCallbackIsValueAccessed \
578 , Func_ZFPropertyCallbackIsInitValue \
579 , Func_ZFPropertyCallbackValueReset \
580 )
582#define ZFPROPERTY_USER_REGISTER_RETAIN(ownerClassSig, \
583 Type, propertyNameSig, InitValueOrEmpty, \
584 SetterAccessType, GetterAccessType \
585 ) \
586 ZFPROPERTY_USER_REGISTER_RETAIN_DETAIL(ownerClassSig, \
587 Type, propertyNameSig, InitValueOrEmpty, \
588 SetterAccessType, GetterAccessType \
589 , ZFPropertyUserRegisterDefaultImplRetain<Type>::setterInvoker \
590 , ZFPropertyUserRegisterDefaultImplRetain<Type>::getterInvoker \
591 , ZFPropertyUserRegisterDefaultImplRetain<Type>::callbackIsValueAccessed \
592 , ZFPropertyUserRegisterDefaultImplRetain<Type>::callbackIsInitValue \
593 , ZFPropertyUserRegisterDefaultImplRetain<Type>::callbackValueReset \
594 )
596#define ZFPROPERTY_USER_REGISTER_RETAIN_DETAIL(ownerClassSig, \
597 Type, propertyNameSig, InitValueOrEmpty, \
598 SetterAccessType, GetterAccessType \
599 , Func_ZFPropertySetterInvoker \
600 , Func_ZFPropertyGetterInvoker \
601 , Func_ZFPropertyCallbackIsValueAccessed \
602 , Func_ZFPropertyCallbackIsInitValue \
603 , Func_ZFPropertyCallbackValueReset \
604 ) \
605 _ZFP_ZFPROPERTY_USER_REGISTER(ownerClassSig, \
606 Type, propertyNameSig, InitValueOrEmpty, \
607 SetterAccessType, GetterAccessType, \
608 Retain, \
609 zftTraits<Type>::TrType::ClassData()->classNameFull(), \
610 zftTraits<Type>::TrType::ClassData() \
611 , Func_ZFPropertySetterInvoker \
612 , Func_ZFPropertyGetterInvoker \
613 , Func_ZFPropertyCallbackIsValueAccessed \
614 , Func_ZFPropertyCallbackIsInitValue \
615 , Func_ZFPropertyCallbackValueReset \
616 )
617
618// ============================================================
620#define ZFPropertyUserRegisterAssign(resultProperty, ownerClass, \
621 Type, propertyNameString, InitValueOrEmpty, \
622 SetterAccessType, GetterAccessType \
623 ) \
624 ZFPropertyUserRegisterAssignDetail(resultProperty, ownerClass, \
625 Type, propertyNameString, InitValueOrEmpty, \
626 SetterAccessType, GetterAccessType \
627 , ZFPropertyUserRegisterDefaultImplAssign<Type>::setterInvoker \
628 , ZFPropertyUserRegisterDefaultImplAssign<Type>::getterInvoker \
629 , ZFPropertyUserRegisterDefaultImplAssign<Type>::callbackIsValueAccessed \
630 , ZFPropertyUserRegisterDefaultImplAssign<Type>::callbackIsInitValue \
631 , ZFPropertyUserRegisterDefaultImplAssign<Type>::callbackValueReset \
632 )
634#define ZFPropertyUserRegisterAssignDetail(resultProperty, ownerClass, \
635 Type, propertyNameString, InitValueOrEmpty, \
636 SetterAccessType, GetterAccessType \
637 , Func_ZFPropertySetterInvoker \
638 , Func_ZFPropertyGetterInvoker \
639 , Func_ZFPropertyCallbackIsValueAccessed \
640 , Func_ZFPropertyCallbackIsInitValue \
641 , Func_ZFPropertyCallbackValueReset \
642 ) \
643 _ZFP_ZFPropertyUserRegister(resultProperty, ownerClass, \
644 Type, propertyNameString, InitValueOrEmpty, \
645 SetterAccessType, GetterAccessType, \
646 Assign, \
647 ZFTypeId<zftTraits<Type>::TrNoRef>::TypeId(), \
648 zfnull \
649 , Func_ZFPropertySetterInvoker \
650 , Func_ZFPropertyGetterInvoker \
651 , Func_ZFPropertyCallbackIsValueAccessed \
652 , Func_ZFPropertyCallbackIsInitValue \
653 , Func_ZFPropertyCallbackValueReset \
654 )
656#define ZFPROPERTY_USER_REGISTER_ASSIGN(ownerClassSig, \
657 Type, propertyNameSig, InitValueOrEmpty, \
658 SetterAccessType, GetterAccessType \
659 ) \
660 ZFPROPERTY_USER_REGISTER_ASSIGN_DETAIL(ownerClassSig, \
661 Type, propertyNameSig, InitValueOrEmpty, \
662 SetterAccessType, GetterAccessType \
663 , ZFPropertyUserRegisterDefaultImplAssign<Type>::setterInvoker \
664 , ZFPropertyUserRegisterDefaultImplAssign<Type>::getterInvoker \
665 , ZFPropertyUserRegisterDefaultImplAssign<Type>::callbackIsValueAccessed \
666 , ZFPropertyUserRegisterDefaultImplAssign<Type>::callbackIsInitValue \
667 , ZFPropertyUserRegisterDefaultImplAssign<Type>::callbackValueReset \
668 )
670#define ZFPROPERTY_USER_REGISTER_ASSIGN_DETAIL(ownerClassSig, \
671 Type, propertyNameSig, InitValueOrEmpty, \
672 SetterAccessType, GetterAccessType \
673 , Func_ZFPropertySetterInvoker \
674 , Func_ZFPropertyGetterInvoker \
675 , Func_ZFPropertyCallbackIsValueAccessed \
676 , Func_ZFPropertyCallbackIsInitValue \
677 , Func_ZFPropertyCallbackValueReset \
678 ) \
679 _ZFP_ZFPROPERTY_USER_REGISTER(ownerClassSig, \
680 Type, propertyNameSig, InitValueOrEmpty, \
681 SetterAccessType, GetterAccessType, \
682 Assign, \
683 ZFTypeId<zftTraits<Type>::TrNoRef>::TypeId(), \
684 zfnull \
685 , Func_ZFPropertySetterInvoker \
686 , Func_ZFPropertyGetterInvoker \
687 , Func_ZFPropertyCallbackIsValueAccessed \
688 , Func_ZFPropertyCallbackIsInitValue \
689 , Func_ZFPropertyCallbackValueReset \
690 )
691
692// ============================================================
695
697#endif // #ifndef _ZFI_ZFPropertyUserRegister_h_
698
#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:192
#define zfextend
dummy macro shows class inherit from another
Definition ZFCoreTypeDef_ClassType.h:53
#define zfdelete(instance)
same as delete defined for future use
Definition ZFCoreTypeDef_ClassType.h:91
#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
#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
#define zfnew(Type,...)
same as new defined for future use
Definition ZFCoreTypeDef_ClassType.h:89
_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
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:126
#define zfRelease(obj)
release an object, see ZFObject
Definition ZFObjectRetain.h:148
#define zfRetain(obj)
retain an object, see ZFObject
Definition ZFObjectRetain.h:128
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:209
info for a property for ZFObject, see ZFPROPERTY_RETAIN for more info
Definition ZFProperty.h:28
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