commit 2025-10-25 08:29 add ZtCPrint & ZtCObjtChain::IterElement() in ZCppMain/ZMainHead.H
This commit is contained in:
@ -815,18 +815,48 @@ namespace ZNsMain
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
template<typename TDataNow> void ZftPrint(const TDataNow& AR_Data)
|
template<typename TDataNow> int ZftPrint(const TDataNow& AR_Data)
|
||||||
{
|
{
|
||||||
cout<<AR_Data;
|
#if defined(_DEBUG_LEVEL) && _DEBUG_LEVEL>=100
|
||||||
}
|
cout<<"# typename TDataNow : "<<typeid(TDataNow).name()<<endl;
|
||||||
/*//////////////////////////////////////////////////////////////*/
|
#endif
|
||||||
|
|
||||||
template<typename TDataNow1, typename TDataNow2> void ZftPrint
|
std::cout<<AR_Data; return 0;
|
||||||
|
}/*
|
||||||
|
template<typename TDataNow> int ZftPrint(const TDataNow& AR_Data)*/
|
||||||
|
|
||||||
|
template<typename TDataNow1, typename TDataNow2> int ZftPrint
|
||||||
(const TDataNow1& AR_Data1, const TDataNow2& AR_Data2)
|
(const TDataNow1& AR_Data1, const TDataNow2& AR_Data2)
|
||||||
{
|
{
|
||||||
cout<<AR_Data1<<AR_Data2;
|
std::cout<<AR_Data1<<AR_Data2; return 0;
|
||||||
}
|
}/*
|
||||||
/*//////////////////////////////////////////////////////////////*/
|
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class ZCPrint /*///////////////////////////////////////////////////////////////*/
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
template<typename TDataNow> int operator ()
|
||||||
|
(const TDataNow& AR_Data){ ZftPrint(AR_Data); return 0; }
|
||||||
|
template<typename TDataNow> int OnPrevIter
|
||||||
|
(const TDataNow& AR_Data){ ZftPrint(", ") ; return 0; }
|
||||||
|
public:
|
||||||
|
};
|
||||||
|
/*/////////////////////////////////////////////////////////////////////////////*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
int ZfInitZero(){ return 0; }
|
||||||
|
/*///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
■ int ZfInitZero()
|
||||||
|
|
||||||
|
템플릿 인자 중에서, 0 으로 초기화하는 functor 가 필요할 때 사용하는 함수.
|
||||||
|
|
||||||
|
ZtCObjtInitChain 에서 사용될 수 있다. -- 2025-10-25 08:27
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////////////////////*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -3733,6 +3763,7 @@ namespace ZNsMain
|
|||||||
|
|
||||||
-- 2025-10-22 19:41
|
-- 2025-10-22 19:41
|
||||||
|
|
||||||
|
|
||||||
ZtCTypeByNo 를 만들고 ZtCObjtChain 에 아래 멤버도 추가하고
|
ZtCTypeByNo 를 만들고 ZtCObjtChain 에 아래 멤버도 추가하고
|
||||||
|
|
||||||
template<int TInTypeNo> typename ZtCTypeByNo
|
template<int TInTypeNo> typename ZtCTypeByNo
|
||||||
@ -4005,6 +4036,38 @@ namespace ZNsMain
|
|||||||
template<typename TViewChain, typename TTypeHelp>
|
template<typename TViewChain, typename TTypeHelp>
|
||||||
void IterTail(TViewChain AO_CView, TTypeHelp AO_TypeHelp)
|
void IterTail(TViewChain AO_CView, TTypeHelp AO_TypeHelp)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
template<typename TViewChain> void IterElement(TViewChain AO_CView)
|
||||||
|
{
|
||||||
|
ZtCTypeData<TViewChain>::
|
||||||
|
GetObjRef(AO_CView).operator()(*this);
|
||||||
|
|
||||||
|
if(TypeChainNow::ZEBoolNext>0)
|
||||||
|
{
|
||||||
|
ZtCTypeData<TViewChain>::
|
||||||
|
GetObjRef(AO_CView).OnPrevIter(*this);
|
||||||
|
|
||||||
|
this->TypeChainNext::IterElement(AO_CView);
|
||||||
|
}/*
|
||||||
|
if(TypeChainNow::ZEBoolNext>0)*/
|
||||||
|
}/*
|
||||||
|
template<typename TViewChain> void IterElement(TViewChain AO_CView)*/
|
||||||
|
template<typename TViewChain> void IterElemRev(TViewChain AO_CView)
|
||||||
|
{
|
||||||
|
if(TypeChainNow::ZEBoolNext>0)
|
||||||
|
{
|
||||||
|
this->TypeChainNext::IterElemRev(AO_CView);
|
||||||
|
|
||||||
|
ZtCTypeData<TViewChain>::
|
||||||
|
GetObjRef(AO_CView).OnPrevIter(*this);
|
||||||
|
}/*
|
||||||
|
if(TypeChainNow::ZEBoolNext>0)*/
|
||||||
|
|
||||||
|
ZtCTypeData<TViewChain>::
|
||||||
|
GetObjRef(AO_CView).operator()(*this);
|
||||||
|
}/*
|
||||||
|
template<typename TViewChain> void IterElemRev(TViewChain AO_CView)*/
|
||||||
|
|
||||||
public:
|
public:
|
||||||
};/*
|
};/*
|
||||||
template ############################################################
|
template ############################################################
|
||||||
@ -4128,6 +4191,20 @@ namespace ZNsMain
|
|||||||
template<typename TViewChain, typename TTypeHelp>
|
template<typename TViewChain, typename TTypeHelp>
|
||||||
void IterTail(TViewChain AO_CView, TTypeHelp AO_TypeHelp)
|
void IterTail(TViewChain AO_CView, TTypeHelp AO_TypeHelp)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
template<typename TViewChain> void IterElement(TViewChain AO_CView)
|
||||||
|
{
|
||||||
|
ZtCTypeData<TViewChain>::
|
||||||
|
GetObjRef(AO_CView).operator()(*this);
|
||||||
|
}/*
|
||||||
|
template<typename TViewChain> void IterElement(TViewChain AO_CView)*/
|
||||||
|
template<typename TViewChain> void IterElemRev(TViewChain AO_CView)
|
||||||
|
{
|
||||||
|
ZtCTypeData<TViewChain>::
|
||||||
|
GetObjRef(AO_CView).operator()(*this);
|
||||||
|
}/*
|
||||||
|
template<typename TViewChain> void IterElemRev(TViewChain AO_CView)*/
|
||||||
|
|
||||||
public:
|
public:
|
||||||
};/*
|
};/*
|
||||||
template ############################################################
|
template ############################################################
|
||||||
@ -4135,6 +4212,17 @@ namespace ZNsMain
|
|||||||
class ZtCObjtChain<TDataNow, ZCEmpty> /////////////////////////////*/
|
class ZtCObjtChain<TDataNow, ZCEmpty> /////////////////////////////*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
template<typename TDataNow, typename TTypeNextChain> int ZftPrint /*:::::::*/
|
||||||
|
( const ZtCObjtChain<TDataNow, TTypeNextChain>& AR_CChain )
|
||||||
|
/*:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::*/
|
||||||
|
{
|
||||||
|
return ZftPrint(*AR_CChain);
|
||||||
|
}
|
||||||
|
/*:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
template<typename TDataNow, typename TTypeNextChain> std::ostream& operator<<
|
template<typename TDataNow, typename TTypeNextChain> std::ostream& operator<<
|
||||||
(
|
(
|
||||||
std::ostream& AR_COStream, const ZtCObjtChain
|
std::ostream& AR_COStream, const ZtCObjtChain
|
||||||
|
|||||||
@ -224,7 +224,9 @@ namespace ZNsMain
|
|||||||
*VO_ZCObjtChain.GetChainByNo<2>()=(1.8);
|
*VO_ZCObjtChain.GetChainByNo<2>()=(1.8);
|
||||||
*VO_ZCObjtChain.GetChainByNo<3>()=(9999);
|
*VO_ZCObjtChain.GetChainByNo<3>()=(9999);
|
||||||
VO_ZCObjtChain.IterHead(ZftMCP(VO_ZCTypeView));
|
VO_ZCObjtChain.IterHead(ZftMCP(VO_ZCTypeView));
|
||||||
cout<<"#VO_ZCObjtChain = "<<VO_ZCObjtChain<<endl;
|
cout<<"# cout<<VO_ZCObjtChain : "<<VO_ZCObjtChain<<endl;
|
||||||
|
cout<<"# VO_ZCObjtChain.IterElemRev(ZCPrint()) : ";
|
||||||
|
VO_ZCObjtChain.IterElemRev(ZCPrint()); cout<<endl;
|
||||||
cout<<"************************************"<<endl;
|
cout<<"************************************"<<endl;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user