edit test.cpp

This commit is contained in:
2021-03-08 22:09:33 +09:00
parent b44c711708
commit eebfc2db5e
4 changed files with 12 additions and 43 deletions

View File

@ -2375,16 +2375,16 @@ namespace ZNsMain
template<typename TType> class ZtCTypeData template<typename TType> class ZtCTypeData
{ public: typedef TType TypeData; { public: typedef TType TypeData;
static TType& GetObjRef(TType& AR_Type ){return AR_Type;}}; static TType& GetObjRef(TType& AR_Type){return AR_Type ;}};
template<typename TType> class ZtCTypeData<TType*> template<typename TType> class ZtCTypeData<TType*>
{ public: typedef TType TypeData; { public: typedef TType TypeData;
static TType& GetObjRef(TType* AP_Type){return *AP_Type;}}; static TType& GetObjRef(TType* AP_Type){return *AP_Type;}};
template<typename TType> class ZtCTypeData<TType&> template<typename TType> class ZtCTypeData<TType&>
{ public: typedef TType TypeData; { public: typedef TType TypeData;
static TType& GetObjRef(TType& AR_Type ){return AR_Type;}}; static TType& GetObjRef(TType& AR_Type){return AR_Type ;}};
template<> class ZtCTypeData<void*> template<> class ZtCTypeData<void*>
{ public: typedef void* TypeData; { public: typedef void* TypeData;
static void* GetObjRef(void* AP_Void){return AP_Void;}}; static void* GetObjRef(void* AP_Void){return AP_Void ;}};
/*//////////////////////////////////////////////////////////////////////////////// /*////////////////////////////////////////////////////////////////////////////////

View File

@ -455,10 +455,6 @@ namespace ZNsMain
형태를 사용하면 좋을 것 같다. -- 2014-06-16 23:11:00 형태를 사용하면 좋을 것 같다. -- 2014-06-16 23:11:00
지금은 AO_TypeHelp 도 ZtCTypeData<> 을 이용해, 최대한 참조로 받을 수 있게
하고 있다. -- 2021-03-08 20:31
/////////////////////////////////////////////////////////////////////////////*/ /////////////////////////////////////////////////////////////////////////////*/
@ -472,7 +468,7 @@ namespace ZNsMain
{ {
ZNsMain::ZtCTypeData<TFunctor>::GetObjRef(AO_Functor) ZNsMain::ZtCTypeData<TFunctor>::GetObjRef(AO_Functor)
( (
*VP_TypeArr, ZCTypeHelp::GetObjRef(AO_TypeHelp) *VP_TypeArr, AO_TypeHelp
); );
++VP_TypeArr; /////////////////////////////////////// ++VP_TypeArr; ///////////////////////////////////////
}/* }/*
@ -502,25 +498,15 @@ namespace ZNsMain
형태를 사용하면 좋을 것 같다. -- 2014-06-16 23:11:00 형태를 사용하면 좋을 것 같다. -- 2014-06-16 23:11:00
지금은 AO_TypeHelp1, 2 도 ZtCTypeData<> 을 이용해, 최대한 참조로 받을 수 있
게 하고 있다. -- 2021-03-08 20:31
/////////////////////////////////////////////////////////////////////////////*/ /////////////////////////////////////////////////////////////////////////////*/
typedef ZNsMain::ZtCTypeData<TTypeHelp1> ZCTypeHelp1;
typedef ZNsMain::ZtCTypeData<TTypeHelp2> ZCTypeHelp2;
Type* VP_TypeArr = mp_TypeArr; Type* VP_TypeArr = mp_TypeArr;
__for0(TypeSize, i, ml_UseSize) __for0(TypeSize, i, ml_UseSize)
{ {
ZNsMain::ZtCTypeData<TFunctor>::GetObjRef(AO_Functor) ZNsMain::ZtCTypeData<TFunctor>::GetObjRef(AO_Functor)
( (
*VP_TypeArr *VP_TypeArr, AO_TypeHelp1, AO_TypeHelp2
, ZCTypeHelp1::GetObjRef(AO_TypeHelp1)
, ZCTypeHelp2::GetObjRef(AO_TypeHelp2)
); );
++VP_TypeArr; /////////////////////////////////////// ++VP_TypeArr; ///////////////////////////////////////
}/* }/*

View File

@ -1524,23 +1524,15 @@ namespace ZNsMain
형태를 사용하면 좋을 것 같다. -- 2014-06-16 23:11:00 형태를 사용하면 좋을 것 같다. -- 2014-06-16 23:11:00
지금은 AO_TypeHelp 도 ZtCTypeData<> 을 이용해, 최대한 참조로 받을 수 있게
하고 있다. -- 2021-03-08 20:31
/////////////////////////////////////////////////////////////////////////////*/ /////////////////////////////////////////////////////////////////////////////*/
typedef ZNsMain::
ZtCTypeData<TTypeHelp> ZCTypeHelp;
ZCLink* VP_LoopLink=mp_HeadLink; ZCLink* VP_LoopLink=mp_HeadLink;
__for0(int, i, ml_Size) __for0(int, i, ml_Size)
{ {
ZtCTypeData<TFunctor>::GetObjRef(AO_Functor) ZtCTypeData<TFunctor>::GetObjRef(AO_Functor)
( (
VP_LoopLink->mo_Type, ZCTypeHelp::GetObjRef(AO_TypeHelp) VP_LoopLink->mo_Type, AO_TypeHelp
); );
//////////////////////////////////////////// ////////////////////////////////////////////
@ -1575,26 +1567,17 @@ namespace ZNsMain
형태를 사용하면 좋을 것 같다. -- 2014-06-16 23:11:00 형태를 사용하면 좋을 것 같다. -- 2014-06-16 23:11:00
지금은 AO_TypeHelp1, 2 도 ZtCTypeData<> 을 이용해, 최대한 참조로 받을 수 있
게 하고 있다. -- 2021-03-08 20:31
/////////////////////////////////////////////////////////////////////////////*/ /////////////////////////////////////////////////////////////////////////////*/
typedef ZNsMain::ZtCTypeData<TTypeHelp1> ZCTypeHelp1;
typedef ZNsMain::ZtCTypeData<TTypeHelp2> ZCTypeHelp2;
ZCLink* VP_LoopLink=mp_HeadLink; ZCLink* VP_LoopLink=mp_HeadLink;
__for0(int, i, ml_Size) __for0(int, i, ml_Size)
{ {
ZtCTypeData<TFunctor>::GetObjRef(AO_Functor) ZtCTypeData<TFunctor>::GetObjRef(AO_Functor)
( (
VP_LoopLink->mo_Type VP_LoopLink->mo_Type, AO_TypeHelp1, AO_TypeHelp2
, ZCTypeHelp1::GetObjRef(AO_TypeHelp1)
, ZCTypeHelp2::GetObjRef(AO_TypeHelp2)
); );
////////////////////////////////////////////
/* 위 코드로 인해서, AO_Functor 이 함수일 때 뿐이 아니라, operator() /* 위 코드로 인해서, AO_Functor 이 함수일 때 뿐이 아니라, operator()
연산자를 가진 object 포인터일 때도 사용할 수 있게 되었다. */ 연산자를 가진 object 포인터일 때도 사용할 수 있게 되었다. */

View File

@ -77,17 +77,17 @@ int main(int ArgiCnt, char** AppArgu)
_FFC_(ZCShowData2) _FFC_(ZCShowData2)
_FFS_(ZCShowData3) _FFS_(ZCShowData3)
(ZTypInt AiInt, ZCTuple& AR_CTuple) (ZTypInt AiInt, ZCTuple* AP_CTuple)
{ {
cout<<"# Elem3 : "<< AiInt << ", nth=" << AR_CTuple._1++ << endl; cout<<"# Elem3 : "<< AiInt << ", nth=" << AP_CTuple->_1++ << endl;
}/* }/*
(ZTypInt AiInt, ZCTuple* AR_CTuple)*/ (ZTypInt AiInt, ZCTuple* AR_CTuple)*/
_FFC_(ZCShowData3) _FFC_(ZCShowData3)
_FFS_(ZCShowData4) _FFS_(ZCShowData4)
(ZTypInt AiInt, ZCTuple& AR_CTuple) (ZTypInt AiInt, ZCTuple* AR_CTuple)
{ {
cout<<"# Elem4 : "<< AiInt << ", nth=" << AR_CTuple._1++ << endl; cout<<"# Elem4 : "<< AiInt << ", nth=" << AP_CTuple->_1++ << endl;
}/* }/*
(ZTypInt AiInt, ZCTuple* AR_CTuple)*/ (ZTypInt AiInt, ZCTuple* AR_CTuple)*/
_FFC_(ZCShowData4) _FFC_(ZCShowData4)