commit 2025-10-04 09:05 add IterElemLink() : ZCppMain/ZtCObjList.H
This commit is contained in:
@ -1930,13 +1930,13 @@ namespace ZNsMain
|
||||
|
||||
TTypSize Find(const ZCLink* AP_pSearchLink, TTypSize AL_FirstFindIndex=1) const
|
||||
{
|
||||
const bool CB_DoStop = ////////////
|
||||
const bool CB_DoStop = //////////////////////
|
||||
(
|
||||
mp_HeadLink ==0 ||
|
||||
AL_FirstFindIndex < 1 ||
|
||||
AL_FirstFindIndex > ml_LinkSize
|
||||
);
|
||||
if(CB_DoStop) {return 0;} /////////
|
||||
if(CB_DoStop) {return 0;} ///////////////////
|
||||
|
||||
|
||||
TTypSize VL_FindIndex = AL_FirstFindIndex ;
|
||||
@ -1949,7 +1949,7 @@ namespace ZNsMain
|
||||
{ return VL_FindIndex; }
|
||||
/*+++++++++++++++++++++++++++*/
|
||||
|
||||
if(VL_FindIndex==ml_LinkSize){return 0; }
|
||||
if(VL_FindIndex==ml_LinkSize){return 0;}
|
||||
|
||||
VP_TempLink = VP_TempLink->mp_NextLink;
|
||||
VL_FindIndex= VL_FindIndex + 1 ;
|
||||
@ -1960,11 +1960,13 @@ namespace ZNsMain
|
||||
|
||||
TTypSize Find(TypeArg AR_TypeArg, TTypSize AL_FirstFindIndex=1)
|
||||
{
|
||||
const bool CB_DoStop =
|
||||
const bool CB_DoStop = //////////////////////
|
||||
(
|
||||
mp_HeadLink==0 || AL_FirstFindIndex<1 || AL_FirstFindIndex>ml_LinkSize
|
||||
mp_HeadLink ==0 ||
|
||||
AL_FirstFindIndex< 1 ||
|
||||
AL_FirstFindIndex> ml_LinkSize
|
||||
);
|
||||
if(CB_DoStop) return 0;
|
||||
if(CB_DoStop) return 0; /////////////////////
|
||||
|
||||
|
||||
TTypSize VL_FindIndex = AL_FirstFindIndex ;
|
||||
@ -2153,10 +2155,10 @@ namespace ZNsMain
|
||||
*/
|
||||
|
||||
|
||||
template<typename TFunctor> void IterElemCut(TFunctor AO_Functor)
|
||||
template<typename TFunctor> void IterElemDel(TFunctor AO_Functor)
|
||||
{
|
||||
// 각 링크에 대하여 AO_Functor(ZCLink*) 함수를 실행한다.
|
||||
// 이 함수를 설계한 이유는 각 링크를 순회하면서 삭제할 수 있도록 하기 위해서다.
|
||||
// 각 링크를 순회하면서 삭제할 수 있게 한 것이다.
|
||||
|
||||
ZCLink* VP_TempPrev = 0 ;
|
||||
ZCLink* VP_TempLink = mp_HeadLink ;
|
||||
@ -2173,7 +2175,7 @@ namespace ZNsMain
|
||||
VP_TempLink = VP_TempLink->mp_NextLink;
|
||||
|
||||
const bool CB_IsTrue = ZtCTypeData<TFunctor>::
|
||||
GetObjRef(AO_Functor)( VP_TempBefore->mo_DataObjt );
|
||||
GetObjRef(AO_Functor)(**VP_TempBefore);
|
||||
|
||||
if(CB_IsTrue)
|
||||
{
|
||||
@ -2193,10 +2195,10 @@ namespace ZNsMain
|
||||
}/*
|
||||
__for1(TTypSize, VL_Loop, VL_Count)*/
|
||||
}/*
|
||||
template<typename TFunctor> void IterElemCut(TFunctor AO_Functor) */
|
||||
template<typename TFunctor> void IterElemDel(TFunctor AO_Functor) */
|
||||
|
||||
|
||||
template<typename TFunctor> void IterEleLink ////////////////////////
|
||||
template<typename TFunctor> void IterElemLink ///////////////////////
|
||||
(
|
||||
ZCLink* AP_StdLink ,
|
||||
TTypSize AL_WorkDistance,
|
||||
@ -2204,10 +2206,8 @@ namespace ZNsMain
|
||||
)
|
||||
/*#################################################################*/
|
||||
{
|
||||
/* AP_StdLink 부터 AL_WorkDistance 만큼 이동하면서
|
||||
/* AP_StdLink 부터 AL_WorkDistance 만큼 이동하면서
|
||||
* 각 ZCLink 에 대하여 AO_Functor() 함수를 수행한다.(총 수행 횟수는 (AL_WorkDistance)절대값+1)
|
||||
* AL_WorkDistance>=0 이면 다음으로 이동하고
|
||||
* AL_WorkDistance <0 이면 이전으로 이동한다.
|
||||
*/
|
||||
|
||||
#ifdef _DEBUG
|
||||
@ -2216,10 +2216,10 @@ namespace ZNsMain
|
||||
{
|
||||
std::fstream fileout("DEBUG.txt",std::ios::out | std::ios::app);
|
||||
fileout<<std::endl<<"File : "<<__FILE__<<std::endl<<"Line : "<<__LINE__<<std::endl;
|
||||
fileout<<"Error In 'void IterEleLink( ZCLink* AP_StdLink ,"<<std::endl;
|
||||
fileout<<" TTypSize AL_WorkDistance,"<<std::endl;
|
||||
fileout<<" TFunctor AO_Functor"<<std::endl;
|
||||
fileout<<" )' :"<<std::endl;
|
||||
fileout<<"Error In 'void IterElemLink( ZCLink* AP_StdLink ,"<<std::endl;
|
||||
fileout<<" TTypSize AL_WorkDistance,"<<std::endl;
|
||||
fileout<<" TFunctor AO_Functor"<<std::endl;
|
||||
fileout<<" )' :"<<std::endl;
|
||||
fileout<<" Parameters are not valid"<<std::endl;
|
||||
fileout.close();
|
||||
exit(1);
|
||||
@ -2237,7 +2237,7 @@ namespace ZNsMain
|
||||
}/*
|
||||
for(TTypSize VL_Loop=0; VL_Loop<=AL_WorkDistance; ++VL_Loop)*/
|
||||
}/*
|
||||
void IterEleLink ////////////////////////////////////////////////////
|
||||
void IterElemLink ///////////////////////////////////////////////////
|
||||
(
|
||||
ZCLink* AP_StdLink ,
|
||||
TTypSize AL_WorkDistance,
|
||||
|
Reference in New Issue
Block a user