commit 2025-10-13 12:28 add ZCLinkPointC ZCppMain/ZtCObjList.H
This commit is contained in:
@ -22,53 +22,59 @@ namespace ZNsMain
|
||||
typedef TTypArg TypeArg ;
|
||||
typedef TSize TypeSize;
|
||||
public:
|
||||
class ZCIterator;
|
||||
class ZCDataPoint;
|
||||
public:
|
||||
typedef Type* IterEasy;
|
||||
typedef ZCIterator iterator;
|
||||
typedef const ZCIterator const_iterator;
|
||||
typedef Type* IterEasy;
|
||||
typedef ZCDataPoint iterator;
|
||||
typedef ZCDataPoint TypeIter;
|
||||
public:
|
||||
typedef const IterEasy IterEasyC;
|
||||
typedef const ZCDataPoint iteratorC;
|
||||
typedef const TypeData TypeDataC;
|
||||
public:
|
||||
typedef const ZCDataPoint const_iterator;
|
||||
public:
|
||||
|
||||
|
||||
class ZCIterator
|
||||
class ZCDataPoint
|
||||
{
|
||||
private: mutable
|
||||
private: mutable
|
||||
Type* mp_Data ; mutable
|
||||
TSize ml_ElePos; // *mp_Data 가 배열에서 차지하는 위치
|
||||
ZtCArray* mp_CArray;
|
||||
public:
|
||||
|
||||
ZCIterator()
|
||||
ZCDataPoint()
|
||||
{
|
||||
mp_Data =0;
|
||||
mp_CArray=0;
|
||||
ml_ElePos=0;
|
||||
}/*
|
||||
ZCIterator()*/
|
||||
ZCDataPoint()*/
|
||||
|
||||
ZCIterator(ZtCArray& AR_CArray, Type& AR_CData, TSize AL_ElePos)
|
||||
ZCDataPoint(ZtCArray& AR_CArray, Type& AR_CData, TSize AL_ElePos)
|
||||
{
|
||||
mp_Data =&AR_CData ;
|
||||
mp_CArray=&AR_CArray;
|
||||
ml_ElePos=AL_ElePos ;
|
||||
}/*
|
||||
ZCIterator(ZtCArray& AR_CArray, Type& AR_CData, TSize AL_ElePos)*/
|
||||
ZCDataPoint(ZtCArray& AR_CArray, Type& AR_CData, TSize AL_ElePos)*/
|
||||
|
||||
ZCIterator(ZtCArray& AR_CArray)
|
||||
ZCDataPoint(ZtCArray& AR_CArray)
|
||||
{
|
||||
mp_Data = AR_CArray.mp_TypeArr ;
|
||||
mp_CArray=&AR_CArray ;
|
||||
ml_ElePos=(AR_CArray.size()>0 ? 1 : 0 ) ;
|
||||
}/*
|
||||
ZCIterator(ZtCArray& AR_CArray)*/
|
||||
ZCDataPoint(ZtCArray& AR_CArray)*/
|
||||
|
||||
ZCIterator(const ZtCArray& AR_CArray)
|
||||
ZCDataPoint(const ZtCArray& AR_CArray)
|
||||
{
|
||||
mp_Data = AR_CArray.mp_TypeArr ;
|
||||
mp_CArray= const_cast<ZtCArray*>(&AR_CArray);
|
||||
ml_ElePos= (AR_CArray.size()>0 ? 1 : 0 ) ;
|
||||
}/*
|
||||
ZCIterator(const ZtCArray& AR_CArray)*/
|
||||
ZCDataPoint(const ZtCArray& AR_CArray)*/
|
||||
|
||||
Type& operator*( ){return *mp_Data;}
|
||||
Type* operator->(){return mp_Data;}
|
||||
@ -76,21 +82,21 @@ namespace ZNsMain
|
||||
const Type& operator* () const{return *mp_Data;}
|
||||
const Type* operator->() const{return mp_Data;}
|
||||
|
||||
ZCIterator& operator++( ){++mp_Data; ++ml_ElePos; return *this;}
|
||||
ZCIterator operator++(int){++mp_Data; ++ml_ElePos; return *this;}
|
||||
ZCDataPoint& operator++( ){++mp_Data; ++ml_ElePos; return *this;}
|
||||
ZCDataPoint operator++(int){++mp_Data; ++ml_ElePos; return *this;}
|
||||
|
||||
const ZCIterator& operator++( ) const{++mp_Data; ++ml_ElePos; return *this;}
|
||||
const ZCIterator operator++(int) const{++mp_Data; ++ml_ElePos; return *this;}
|
||||
const ZCDataPoint& operator++( ) const{++mp_Data; ++ml_ElePos; return *this;}
|
||||
const ZCDataPoint operator++(int) const{++mp_Data; ++ml_ElePos; return *this;}
|
||||
|
||||
ZCIterator operator+(TSize AL_AddPos) const
|
||||
ZCDataPoint operator+(TSize AL_AddPos) const
|
||||
{
|
||||
return ZCIterator(*this, mp_Data+AL_AddPos, ml_ElePos+AL_AddPos);
|
||||
return ZCDataPoint(*this, mp_Data+AL_AddPos, ml_ElePos+AL_AddPos);
|
||||
}/*
|
||||
ZCIterator operator+(TSize AL_AddPos) const*/
|
||||
ZCDataPoint operator+(TSize AL_AddPos) const*/
|
||||
|
||||
public:
|
||||
};/*
|
||||
class ZCIterator
|
||||
class ZCDataPoint
|
||||
|
||||
|
||||
public :*/
|
||||
@ -339,8 +345,8 @@ namespace ZNsMain
|
||||
Type& push_front(){return AddHead();}
|
||||
Type& push_back (){return AddTail();}
|
||||
|
||||
/***/ ZCIterator begin() {return ZCIterator(*this);}
|
||||
const ZCIterator begin() const{return ZCIterator(*this);}
|
||||
/***/ ZCDataPoint begin() {return ZCDataPoint(*this);}
|
||||
const ZCDataPoint begin() const{return ZCDataPoint(*this);}
|
||||
|
||||
|
||||
template<typename TFunctor> void IterElement(TFunctor AO_Functor)
|
||||
|
Reference in New Issue
Block a user