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 , zfnull \
309 , ownerClass \
310 , propertyNameString \
311 , zftext(#Type) \
312 , ZFTypeId_noneOrType \
313 , setterMethod \
314 , getterMethod \
315 , propertyClassOfRetainProperty \
316 , Func_ZFPropertyCallbackIsValueAccessed \
317 , Func_ZFPropertyCallbackIsInitValue \
318 , Func_ZFPropertyCallbackValueReset \
319 , _ZFP_PropURInit_##registerSig::I \
320 , zfnull \
321 , zfnull \
322 , zfnull \
323 );
324#define _ZFP_ZFPropertyUserRegister_ParamExpand_Assign( \
325 registerSig, \
326 ownerClass, \
327 Type, propertyNameString, \
328 ZFTypeId_noneOrType, \
329 setterMethod, \
330 getterMethod, \
331 propertyClassOfRetainProperty \
332 , Func_ZFPropertyCallbackIsValueAccessed \
333 , Func_ZFPropertyCallbackIsInitValue \
334 , Func_ZFPropertyCallbackValueReset \
335 ) \
336 ( \
337 zftrue \
338 , zffalse \
339 , zfnull \
340 , ownerClass \
341 , propertyNameString \
342 , zftext(#Type) \
343 , ZFTypeId_noneOrType \
344 , setterMethod \
345 , getterMethod \
346 , propertyClassOfRetainProperty \
347 , Func_ZFPropertyCallbackIsValueAccessed \
348 , Func_ZFPropertyCallbackIsInitValue \
349 , Func_ZFPropertyCallbackValueReset \
350 , _ZFP_PropURInit_##registerSig::I \
351 , zfnull \
352 , zfnull \
353 , zfnull \
354 )
355
356// ============================================================
357#define _ZFP_ZFPropertyUserRegister(resultProperty, ownerClass, \
358 Type, propertyNameString, InitValueOrEmpty, \
359 SetterAccessType, GetterAccessType, \
360 RetainOrAssign, \
361 ZFTypeId_noneOrType, \
362 propertyClassOfRetainProperty \
363 , Func_ZFPropertySetterInvoker \
364 , Func_ZFPropertyGetterInvoker \
365 , Func_ZFPropertyCallbackIsValueAccessed \
366 , Func_ZFPropertyCallbackIsInitValue \
367 , Func_ZFPropertyCallbackValueReset \
368 ) \
369 const ZFProperty *resultProperty = zfnull; \
370 { \
371 ZFCoreMutexLocker(); \
372 const ZFClass *_ownerClass = ownerClass; \
373 zfstring _propertyName(propertyNameString); \
374 \
375 ZFMethodUserRegisterDetail_1(setterMethod, { \
376 Func_ZFPropertySetterInvoker(invokerMethod, invokerObject, value); \
377 }, _ownerClass, SetterAccessType, ZFMethodTypeVirtual, \
378 void, _propertyName, \
379 ZFMP_IN(Type const &, value)); \
380 ZFMethodUserRegisterDetail_0(getterMethod, { \
381 return Func_ZFPropertyGetterInvoker(invokerMethod, invokerObject); \
382 }, _ownerClass, GetterAccessType, ZFMethodTypeVirtual, \
383 Type const &, _propertyName); \
384 _ZFP_ZFPropertyUserRegister_PropInit_##RetainOrAssign(_, Type, InitValueOrEmpty) \
385 resultProperty = ZFProperty::_ZFP_ZFPropertyRegister _ZFP_ZFPropertyUserRegister_ParamExpand_##RetainOrAssign( \
386 _, _ownerClass, \
387 Type, _propertyName, \
388 ZFTypeId_noneOrType, \
389 setterMethod, getterMethod, \
390 propertyClassOfRetainProperty \
391 , Func_ZFPropertyCallbackIsValueAccessed \
392 , Func_ZFPropertyCallbackIsInitValue \
393 , Func_ZFPropertyCallbackValueReset \
394 ); \
395 } \
396 ZFUNUSED(resultProperty)
397
398#define _ZFP_ZFPROPERTY_USER_REGISTER(ownerClassSig, \
399 Type, propertyNameSig, InitValueOrEmpty, \
400 SetterAccessType, GetterAccessType, \
401 RetainOrAssign, \
402 ZFTypeId_noneOrType, \
403 propertyClassOfRetainProperty \
404 , Func_ZFPropertySetterInvoker \
405 , Func_ZFPropertyGetterInvoker \
406 , Func_ZFPropertyCallbackIsValueAccessed \
407 , Func_ZFPropertyCallbackIsInitValue \
408 , Func_ZFPropertyCallbackValueReset \
409 ) \
410 zfclassNotPOD _ZFP_PropURMH_##ownerClassSig##_##propertyNameSig { \
411 public: \
412 static const ZFMethod *S(void) { \
413 ZFMethodUserRegisterDetail_1(setterMethod, { \
414 Func_ZFPropertySetterInvoker(invokerMethod, invokerObject, value); \
415 }, ownerClassSig::ClassData(), SetterAccessType, ZFMethodTypeVirtual, \
416 void, zftext(#propertyNameSig), \
417 ZFMP_IN(Type const &, value)); \
418 return setterMethod; \
419 } \
420 static const ZFMethod *G(void) { \
421 ZFMethodUserRegisterDetail_0(getterMethod, { \
422 return Func_ZFPropertyGetterInvoker(invokerMethod, invokerObject); \
423 }, ownerClassSig::ClassData(), GetterAccessType, ZFMethodTypeVirtual, \
424 Type const &, zftext(#propertyNameSig)); \
425 return getterMethod; \
426 } \
427 }; \
428 _ZFP_ZFPropertyUserRegister_PropInit_##RetainOrAssign(ownerClassSig##_##propertyNameSig, Type, InitValueOrEmpty) \
429 static _ZFP_ZFPropertyRegisterHolder _ZFP_PropURH_##ownerClassSig##_##propertyNameSig \
430 _ZFP_ZFPropertyUserRegister_ParamExpand_##RetainOrAssign( \
431 ownerClassSig##_##propertyNameSig, ownerClassSig::ClassData(), \
432 Type, zftext(#propertyNameSig), \
433 ZFTypeId_noneOrType, \
434 _ZFP_PropURMH_##ownerClassSig##_##propertyNameSig::S(), \
435 _ZFP_PropURMH_##ownerClassSig##_##propertyNameSig::G(), \
436 propertyClassOfRetainProperty \
437 , Func_ZFPropertyCallbackIsValueAccessed \
438 , Func_ZFPropertyCallbackIsInitValue \
439 , Func_ZFPropertyCallbackValueReset \
440 );
441
442// ============================================================
541#define ZFPropertyUserRegisterRetain(resultProperty, ownerClass, \
542 Type, propertyNameString, InitValueOrEmpty, \
543 SetterAccessType, GetterAccessType \
544 ) \
545 ZFPropertyUserRegisterRetainDetail(resultProperty, ownerClass, \
546 Type, propertyNameString, InitValueOrEmpty, \
547 SetterAccessType, GetterAccessType \
548 , ZFPropertyUserRegisterDefaultImplRetain<Type>::setterInvoker \
549 , ZFPropertyUserRegisterDefaultImplRetain<Type>::getterInvoker \
550 , ZFPropertyUserRegisterDefaultImplRetain<Type>::callbackIsValueAccessed \
551 , ZFPropertyUserRegisterDefaultImplRetain<Type>::callbackIsInitValue \
552 , ZFPropertyUserRegisterDefaultImplRetain<Type>::callbackValueReset \
553 )
555#define ZFPropertyUserRegisterRetainDetail(resultProperty, ownerClass, \
556 Type, propertyNameString, InitValueOrEmpty, \
557 SetterAccessType, GetterAccessType \
558 , Func_ZFPropertySetterInvoker \
559 , Func_ZFPropertyGetterInvoker \
560 , Func_ZFPropertyCallbackIsValueAccessed \
561 , Func_ZFPropertyCallbackIsInitValue \
562 , Func_ZFPropertyCallbackValueReset \
563 ) \
564 _ZFP_ZFPropertyUserRegister(resultProperty, ownerClass, \
565 Type, propertyNameString, InitValueOrEmpty, \
566 SetterAccessType, GetterAccessType, \
567 Retain, \
568 zftTraits<Type>::TrType::ClassData()->classNameFull(), \
569 zftTraits<Type>::TrType::ClassData() \
570 , Func_ZFPropertySetterInvoker \
571 , Func_ZFPropertyGetterInvoker \
572 , Func_ZFPropertyCallbackIsValueAccessed \
573 , Func_ZFPropertyCallbackIsInitValue \
574 , Func_ZFPropertyCallbackValueReset \
575 )
577#define ZFPROPERTY_USER_REGISTER_RETAIN(ownerClassSig, \
578 Type, propertyNameSig, InitValueOrEmpty, \
579 SetterAccessType, GetterAccessType \
580 ) \
581 ZFPROPERTY_USER_REGISTER_RETAIN_DETAIL(ownerClassSig, \
582 Type, propertyNameSig, InitValueOrEmpty, \
583 SetterAccessType, GetterAccessType \
584 , ZFPropertyUserRegisterDefaultImplRetain<Type>::setterInvoker \
585 , ZFPropertyUserRegisterDefaultImplRetain<Type>::getterInvoker \
586 , ZFPropertyUserRegisterDefaultImplRetain<Type>::callbackIsValueAccessed \
587 , ZFPropertyUserRegisterDefaultImplRetain<Type>::callbackIsInitValue \
588 , ZFPropertyUserRegisterDefaultImplRetain<Type>::callbackValueReset \
589 )
591#define ZFPROPERTY_USER_REGISTER_RETAIN_DETAIL(ownerClassSig, \
592 Type, propertyNameSig, InitValueOrEmpty, \
593 SetterAccessType, GetterAccessType \
594 , Func_ZFPropertySetterInvoker \
595 , Func_ZFPropertyGetterInvoker \
596 , Func_ZFPropertyCallbackIsValueAccessed \
597 , Func_ZFPropertyCallbackIsInitValue \
598 , Func_ZFPropertyCallbackValueReset \
599 ) \
600 _ZFP_ZFPROPERTY_USER_REGISTER(ownerClassSig, \
601 Type, propertyNameSig, InitValueOrEmpty, \
602 SetterAccessType, GetterAccessType, \
603 Retain, \
604 zftTraits<Type>::TrType::ClassData()->classNameFull(), \
605 zftTraits<Type>::TrType::ClassData() \
606 , Func_ZFPropertySetterInvoker \
607 , Func_ZFPropertyGetterInvoker \
608 , Func_ZFPropertyCallbackIsValueAccessed \
609 , Func_ZFPropertyCallbackIsInitValue \
610 , Func_ZFPropertyCallbackValueReset \
611 )
612
613// ============================================================
615#define ZFPropertyUserRegisterAssign(resultProperty, ownerClass, \
616 Type, propertyNameString, InitValueOrEmpty, \
617 SetterAccessType, GetterAccessType \
618 ) \
619 ZFPropertyUserRegisterAssignDetail(resultProperty, ownerClass, \
620 Type, propertyNameString, InitValueOrEmpty, \
621 SetterAccessType, GetterAccessType \
622 , ZFPropertyUserRegisterDefaultImplAssign<Type>::setterInvoker \
623 , ZFPropertyUserRegisterDefaultImplAssign<Type>::getterInvoker \
624 , ZFPropertyUserRegisterDefaultImplAssign<Type>::callbackIsValueAccessed \
625 , ZFPropertyUserRegisterDefaultImplAssign<Type>::callbackIsInitValue \
626 , ZFPropertyUserRegisterDefaultImplAssign<Type>::callbackValueReset \
627 )
629#define ZFPropertyUserRegisterAssignDetail(resultProperty, ownerClass, \
630 Type, propertyNameString, InitValueOrEmpty, \
631 SetterAccessType, GetterAccessType \
632 , Func_ZFPropertySetterInvoker \
633 , Func_ZFPropertyGetterInvoker \
634 , Func_ZFPropertyCallbackIsValueAccessed \
635 , Func_ZFPropertyCallbackIsInitValue \
636 , Func_ZFPropertyCallbackValueReset \
637 ) \
638 _ZFP_ZFPropertyUserRegister(resultProperty, ownerClass, \
639 Type, propertyNameString, InitValueOrEmpty, \
640 SetterAccessType, GetterAccessType, \
641 Assign, \
642 ZFTypeId<zftTraits<Type>::TrNoRef>::TypeId(), \
643 zfnull \
644 , Func_ZFPropertySetterInvoker \
645 , Func_ZFPropertyGetterInvoker \
646 , Func_ZFPropertyCallbackIsValueAccessed \
647 , Func_ZFPropertyCallbackIsInitValue \
648 , Func_ZFPropertyCallbackValueReset \
649 )
651#define ZFPROPERTY_USER_REGISTER_ASSIGN(ownerClassSig, \
652 Type, propertyNameSig, InitValueOrEmpty, \
653 SetterAccessType, GetterAccessType \
654 ) \
655 ZFPROPERTY_USER_REGISTER_ASSIGN_DETAIL(ownerClassSig, \
656 Type, propertyNameSig, InitValueOrEmpty, \
657 SetterAccessType, GetterAccessType \
658 , ZFPropertyUserRegisterDefaultImplAssign<Type>::setterInvoker \
659 , ZFPropertyUserRegisterDefaultImplAssign<Type>::getterInvoker \
660 , ZFPropertyUserRegisterDefaultImplAssign<Type>::callbackIsValueAccessed \
661 , ZFPropertyUserRegisterDefaultImplAssign<Type>::callbackIsInitValue \
662 , ZFPropertyUserRegisterDefaultImplAssign<Type>::callbackValueReset \
663 )
665#define ZFPROPERTY_USER_REGISTER_ASSIGN_DETAIL(ownerClassSig, \
666 Type, propertyNameSig, InitValueOrEmpty, \
667 SetterAccessType, GetterAccessType \
668 , Func_ZFPropertySetterInvoker \
669 , Func_ZFPropertyGetterInvoker \
670 , Func_ZFPropertyCallbackIsValueAccessed \
671 , Func_ZFPropertyCallbackIsInitValue \
672 , Func_ZFPropertyCallbackValueReset \
673 ) \
674 _ZFP_ZFPROPERTY_USER_REGISTER(ownerClassSig, \
675 Type, propertyNameSig, InitValueOrEmpty, \
676 SetterAccessType, GetterAccessType, \
677 Assign, \
678 ZFTypeId<zftTraits<Type>::TrNoRef>::TypeId(), \
679 zfnull \
680 , Func_ZFPropertySetterInvoker \
681 , Func_ZFPropertyGetterInvoker \
682 , Func_ZFPropertyCallbackIsValueAccessed \
683 , Func_ZFPropertyCallbackIsInitValue \
684 , Func_ZFPropertyCallbackValueReset \
685 )
686
687// ============================================================
690
692#endif // #ifndef _ZFI_ZFPropertyUserRegister_h_
693
#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:196
#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:184
#define ZF_IN_OPT
dummy macro that shows the param used as optional input
Definition ZFCoreTypeDef_ClassType.h:188
#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 zfpoolNew
Definition ZFMemPool.h:38
#define zfpoolNew(T_Type,...)
internal use only, for allocating internal types for performance
Definition ZFMemPool.h:37
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 zfobjRetain(obj)
retain an object, see ZFObject
Definition ZFObjectRetain.h:128
#define zfobjRelease(obj)
release an object, see ZFObject
Definition ZFObjectRetain.h:148
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:196
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