commit 2025-10-14 09:39 add end() : ZCppMain/ZtCArray
This commit is contained in:
@ -54,6 +54,35 @@ namespace ZNsMain
|
||||
TypeSize ml_ElePos; // *mp_Data 가 배열에서 차지하는 위치
|
||||
public:
|
||||
|
||||
static ZCNodePoint MakeTailPoint(ZtCArray & AR_CArray)
|
||||
{
|
||||
ZCNodePoint VO_ZCLinkPoint(AR_CArray);
|
||||
|
||||
if(AR_CArray.size()>0) /****************************/
|
||||
{
|
||||
VO_ZCLinkPoint.mp_Data = &AR_CArray.mp_TypeArr[AR_CArray.size()-1] ;
|
||||
VO_ZCLinkPoint.ml_ElePos = AR_CArray.size() ;
|
||||
}
|
||||
return VO_ZCLinkPoint; /****************************/
|
||||
}/*
|
||||
static ZCNodePoint MakeTailPoint(ZtCArray & AR_CArray)*/
|
||||
static ZCNodePoint MakeTailPoint(TypeIterC& AR_TypeIter)
|
||||
{
|
||||
ZCNodePoint VO_ZCLinkPoint(AR_TypeIter);
|
||||
|
||||
const TypeSize VL_ArrSize = AR_TypeIter.mr_CArray.size();
|
||||
|
||||
if(VL_ArrSize>0) /**********************************/
|
||||
{
|
||||
VO_ZCLinkPoint.mp_Data = &AR_TypeIter.mr_CArray[VL_ArrSize-1] ;
|
||||
VO_ZCLinkPoint.ml_ElePos = VL_ArrSize ;
|
||||
}
|
||||
return VO_ZCLinkPoint; /****************************/
|
||||
}/*
|
||||
static ZCNodePoint MakeTailPoint(TypeIterC& AR_TypeIter)*/
|
||||
|
||||
public:
|
||||
|
||||
ZCNodePoint(ZtCArray& AR_CArray, Type& AR_CData, TSize AL_ElePos) :
|
||||
mr_CArray(AR_CArray)
|
||||
/*****************************************************************/
|
||||
@ -72,7 +101,7 @@ namespace ZNsMain
|
||||
|
||||
ZCNodePoint(const ZCNodePoint& rhs) : mr_CArray(rhs.mr_CArray)
|
||||
{
|
||||
mp_Data = rhs.mp_TypeArr ;
|
||||
mp_Data = rhs.mp_Data ;
|
||||
ml_ElePos= (mr_CArray.size()>0 ? 1 : 0 );
|
||||
}/*
|
||||
ZCNodePoint(const ZCNodePoint& rhs)*/
|
||||
@ -94,9 +123,13 @@ namespace ZNsMain
|
||||
|
||||
TypeIter & operator++( ) {++mp_Data; ++ml_ElePos; return *this;}
|
||||
TypeIter operator++(int) {++mp_Data; ++ml_ElePos; return *this;}
|
||||
TypeIter & operator--( ) {--mp_Data; --ml_ElePos; return *this;}
|
||||
TypeIter operator--(int) {--mp_Data; --ml_ElePos; return *this;}
|
||||
|
||||
ZCNodePointC& operator++( ) const{++mp_Data; ++ml_ElePos; return *this;}
|
||||
ZCNodePointC operator++(int) const{++mp_Data; ++ml_ElePos; return *this;}
|
||||
ZCNodePointC& operator--( ) const{--mp_Data; --ml_ElePos; return *this;}
|
||||
ZCNodePointC operator--(int) const{--mp_Data; --ml_ElePos; return *this;}
|
||||
|
||||
TypeIter operator+(TSize AL_AddPos) const
|
||||
{
|
||||
@ -144,32 +177,74 @@ namespace ZNsMain
|
||||
const ZtCArray& mr_CArray;
|
||||
public:
|
||||
|
||||
static ZCNodePointN MakeTailPoint(ZtCArray & AR_CArray)
|
||||
{
|
||||
ZCNodePointN VO_ZCLinkPoint(AR_CArray);
|
||||
|
||||
if(AR_CArray.size()>0) /****************************/
|
||||
{
|
||||
VO_ZCLinkPoint.mp_Data = &AR_CArray.mp_TypeArr[AR_CArray.size()-1] ;
|
||||
VO_ZCLinkPoint.ml_ElePos = AR_CArray.size() ;
|
||||
}
|
||||
return VO_ZCLinkPoint; /****************************/
|
||||
}/*
|
||||
static ZCNodePointN MakeTailPoint(ZtCArray & AR_CArray)*/
|
||||
static ZCNodePointN MakeTailPoint(TypeIterC& AR_TypeIter)
|
||||
{
|
||||
ZCNodePointN VO_ZCLinkPoint(AR_TypeIter);
|
||||
|
||||
const TypeSize VL_ArrSize = AR_TypeIter.mr_CArray.size();
|
||||
|
||||
if(VL_ArrSize>0) /**********************************/
|
||||
{
|
||||
VO_ZCLinkPoint.mp_Data = &AR_TypeIter.mr_CArray[VL_ArrSize-1] ;
|
||||
VO_ZCLinkPoint.ml_ElePos = VL_ArrSize ;
|
||||
}
|
||||
return VO_ZCLinkPoint; /****************************/
|
||||
}/*
|
||||
static ZCNodePointN MakeTailPoint(TypeIterC& AR_TypeIter)*/
|
||||
static ZCNodePointN MakeTailPoint(TypeIterN& AR_TypeIter)
|
||||
{
|
||||
ZCNodePointN VO_ZCLinkPoint(AR_TypeIter);
|
||||
|
||||
const TypeSize VL_ArrSize = AR_TypeIter.mr_CArray.size();
|
||||
|
||||
if(VL_ArrSize>0) /**********************************/
|
||||
{
|
||||
VO_ZCLinkPoint.mp_Data = &AR_TypeIter.mr_CArray[VL_ArrSize-1] ;
|
||||
VO_ZCLinkPoint.ml_ElePos = VL_ArrSize ;
|
||||
}
|
||||
return VO_ZCLinkPoint; /****************************/
|
||||
}/*
|
||||
static ZCNodePointN MakeTailPoint(TypeIterN& AR_TypeIter)*/
|
||||
|
||||
public:
|
||||
|
||||
ZCNodePointN(const ZtCArray& AR_CArray, Type& AR_CData, TSize AL_ElePos) :
|
||||
mr_CArray(AR_CArray)
|
||||
/*****************************************************************/
|
||||
{
|
||||
mp_Data =&AR_CData ;
|
||||
mr_CArray=&AR_CArray;
|
||||
ml_ElePos=AL_ElePos ;
|
||||
}/*
|
||||
ZCNodePointN(ZtCArray& AR_CArray, Type& AR_CData, TSize AL_ElePos)*/
|
||||
|
||||
ZCNodePointN(ZtCArray& AR_CArray) : mr_CArray(AR_CArray)
|
||||
{
|
||||
mp_Data = AR_CArray.mp_TypeArr ;
|
||||
mp_Data = AR_CArray.mp_Data ;
|
||||
ml_ElePos=(AR_CArray.size()>0 ? 1 : 0 ) ;
|
||||
}/*
|
||||
ZCNodePointN(ZtCArray& AR_CArray)*/
|
||||
|
||||
ZCNodePointN(const ZCNodePointN& rhs) : mr_CArray(rhs.mr_CArray)
|
||||
{
|
||||
mp_Data = rhs.mp_TypeArr ;
|
||||
mp_Data = rhs.mp_Data ;
|
||||
ml_ElePos=(mr_CArray.size()>0 ? 1 : 0 ) ;
|
||||
}/*
|
||||
ZCNodePointN(const ZCNodePointN& rhs)*/
|
||||
ZCNodePointN(const ZCNodePoint & rhs) : mr_CArray(rhs.mr_CArray)
|
||||
{
|
||||
mp_Data = rhs.mp_TypeArr ;
|
||||
mp_Data = rhs.mp_Data ;
|
||||
ml_ElePos=(mr_CArray.size()>0 ? 1 : 0 ) ;
|
||||
}/*
|
||||
ZCNodePointN(const ZCNodePoint & rhs)*/
|
||||
@ -470,8 +545,14 @@ namespace ZNsMain
|
||||
TypeData& push_front(){return AddHead();}
|
||||
TypeData& push_back (){return AddTail();}
|
||||
|
||||
TypeIter begin() {return ZCNodePoint (*this);}
|
||||
TypeIterN begin() const{return ZCNodePointN(*this);}
|
||||
TypeIter begin () {return ZCNodePoint (*this);}
|
||||
TypeIterN begin () const{return ZCNodePointN(*this);}
|
||||
|
||||
iterator end () { return ZCNodePoint ::MakeTailPoint(*this); }
|
||||
iteratorN end () const{ return ZCNodePointN::MakeTailPoint(*this); }
|
||||
|
||||
iteratorN cbegin() const{ return ZCNodePointN(*this); }
|
||||
iteratorN cend () const{ return ZCNodePointN::MakeTailPoint(*this); }
|
||||
|
||||
|
||||
template<typename TFunctor> void IterElement(TFunctor AO_Functor)
|
||||
|
Reference in New Issue
Block a user