diff --git a/ZCppMain/ZMainHead.H b/ZCppMain/ZMainHead.H index 0267a8c..bce5ff0 100644 --- a/ZCppMain/ZMainHead.H +++ b/ZCppMain/ZMainHead.H @@ -1211,6 +1211,18 @@ namespace ZNsMain { public: typedef ZfpNone TypeData; static ZfpNone GetObjRef(void* AP_Void){return ZfNone ;}}; + template class ZtCTypeData< ZtCRef > + { public: typedef TType TypeData; static TType& + GetObjRef(ZtCRef& AR_CRef) + {return AR_CRef.GetData() /*//////////////*/ ;} + }; + template class ZtCTypeData< ZtCRef* > + { public: typedef TType TypeData; static TType& + GetObjRef(ZtCRef* AP_CRef) + {return *reinterpret_cast(AP_CRef);} + }; + + template class ZtCTD { public: typedef TType TypeData; static TType& GetObjRef(TType& AR_Type){return AR_Type ;} @@ -1229,6 +1241,21 @@ namespace ZNsMain static ZfpNone GOR (void* AP_Void){return ZfNone ;}}; + template class ZtCTD< ZtCRef > + { public: typedef TType TypeData; + static TType& GetObjRef(ZtCRef& AR_CRef){return AR_CRef.GetData() ;} + static TType& GOR (ZtCRef& AR_CRef){return AR_CRef.GetData() ;} + }; + template class ZtCTD< ZtCRef* > + { public: typedef TType TypeData; + static TType& GetObjRef(ZtCRef* AP_CRef) + {return *reinterpret_cast(AP_CRef);} + static TType& GOR (ZtCRef* AP_CRef) + {return *reinterpret_cast(AP_CRef);} + }; + + + /*///////////////////////////////////////////////////////////////////////////////////////////// ■ template 인수가 Type11 까지 있음에 주의한다. 그러면 Type10 까지 전문화할 수 있는 것이다. diff --git a/ZCppMain/ZtCObjList.H b/ZCppMain/ZtCObjList.H index b34c608..02edf2b 100644 --- a/ZCppMain/ZtCObjList.H +++ b/ZCppMain/ZtCObjList.H @@ -2328,6 +2328,8 @@ namespace ZNsMain /* 위 코드로 인해서, AO_Functor 이 함수일 때 뿐이 아니라, operator() 연산자를 가진 object 포인터일 때도 사용할 수 있게 되었다. + + 이제는 ZftMCP() 템플릿 함수를 사용해도 된다. -- 2025-09-27 00:38 */ VP_LoopLink = VP_LoopLink->mp_NextLink ; }/* diff --git a/ZCppMainTest/ZtCSimList_000.cpp b/ZCppMainTest/ZtCSimList_000.cpp index 488907a..7ed5b7b 100644 --- a/ZCppMainTest/ZtCSimList_000.cpp +++ b/ZCppMainTest/ZtCSimList_000.cpp @@ -19,20 +19,44 @@ namespace ZNsMain { public: + + typedef ZtCStringBase CStringBase ; + typedef const CStringBase CCStringBase; + + /* 아래 자료형에 대해, CStringBase::Fetch() 호출 여부 실험. + + ZtCSimList + ZtCSimList + + */ + typedef ZtCSimList + CStringList1 ; + typedef ZtCSimList + CStringList2 ; + + + class CHelpObj { public: + int mi_CallNo; + public: - CHelpObj() + CHelpObj() : mi_CallNo(0) { cout<<"* CHelpObj()"< CStringBase ; - typedef const CStringBase CCStringBase; - - /* 아래 자료형에 대해, CStringBase::Fetch() 호출 여부 실험. - - ZtCSimList - ZtCSimList - - */ - typedef ZtCSimList - CStringList1 ; - typedef ZtCSimList - CStringList2 ; - static void ShowDataInNode(const CStringBase& AR_Data) { @@ -216,6 +226,12 @@ namespace ZNsMain cout<<"# list11 IterElement ####" <