commit 2025-10-03 23:48 add capacity() & size_free() in ZtCBaseList : ZCppMain/ZMainHead.H
This commit is contained in:
@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
■ unsigned 정수형은 가급적이면 쓰지 말자. 일반적으로 많이 쓰는 signed 정수와의 호환이
|
■ unsigned 정수형은 가급적이면 쓰지 말자. 일반적으로 많이 쓰는 signed 정수와의 호환이
|
||||||
'약간' 거슬리고 있는데, 이 '약간' 이라도 왠지 찝찝하다. 2008-09-14 03:24:00
|
'약간' 거슬리고 있는데, 이 '약간' 이라도 왠지 찝찝하다. 2008-09-14 03:24:00
|
||||||
|
|
||||||
■ 해당 namespace 에서 필요한 상수는 그 namespace 안에서 상수전용 namespace ZNsConst 를
|
■ 해당 namespace 에서 필요한 상수는 그 namespace 안에서 상수전용 namespace ZNsConst 를
|
||||||
만들고 그 안에 둔다.
|
만들고 그 안에 둔다.
|
||||||
|
|
||||||
@ -4111,12 +4112,6 @@ namespace ZNsMain
|
|||||||
}/*
|
}/*
|
||||||
_NP_ TypeSize size() const*/
|
_NP_ TypeSize size() const*/
|
||||||
|
|
||||||
_NP_ TypeSize capacity() const
|
|
||||||
{
|
|
||||||
return GetAllHeapSize();
|
|
||||||
}/*
|
|
||||||
_NP_ TypeSize capacity() const*/
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
};/*
|
};/*
|
||||||
template<typename TLinkList> class ZtCBody*/
|
template<typename TLinkList> class ZtCBody*/
|
||||||
@ -4283,31 +4278,14 @@ namespace ZNsMain
|
|||||||
}/*
|
}/*
|
||||||
_NP_ TypeSize GetUseHeapSize() const*/
|
_NP_ TypeSize GetUseHeapSize() const*/
|
||||||
|
|
||||||
_NP_ TypeSize GetAllHeapSize() const
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}/*
|
|
||||||
_NP_ TypeSize GetAllHeapSize() const*/
|
|
||||||
|
|
||||||
|
|
||||||
_NP_ TypeSize size() const
|
_NP_ TypeSize size() const
|
||||||
{
|
{
|
||||||
return GetUseHeapSize();
|
return GetUseHeapSize();
|
||||||
}/*
|
}/*
|
||||||
_NP_ TypeSize GetHeapSize() const*/
|
_NP_ TypeSize size() const*/
|
||||||
|
|
||||||
_NP_ TypeSize capacity() const
|
|
||||||
{
|
|
||||||
return GetAllHeapSize();
|
|
||||||
}/*
|
|
||||||
_NP_ TypeSize capacity() const*/
|
|
||||||
|
|
||||||
|
|
||||||
_NP_ void ChangeCapacity(TypeSize AI_AddCut)
|
|
||||||
{
|
|
||||||
}/*
|
|
||||||
_NP_ void ChangeCapacity(TypeSize AI_AddCut)*/
|
|
||||||
|
|
||||||
|
public:
|
||||||
};/*
|
};/*
|
||||||
template<typename TSnglList> class ZtCBody*/
|
template<typename TSnglList> class ZtCBody*/
|
||||||
|
|
||||||
@ -4435,31 +4413,13 @@ namespace ZNsMain
|
|||||||
}/*
|
}/*
|
||||||
_NP_ TypeSize GetUseHeapSize() const*/
|
_NP_ TypeSize GetUseHeapSize() const*/
|
||||||
|
|
||||||
_NP_ TypeSize GetAllHeapSize() const
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}/*
|
|
||||||
_NP_ TypeSize GetAllHeapSize() const*/
|
|
||||||
|
|
||||||
|
|
||||||
_NP_ TypeSize size() const
|
_NP_ TypeSize size() const
|
||||||
{
|
{
|
||||||
return GetUseHeapSize();
|
return GetUseHeapSize();
|
||||||
}/*
|
}/*
|
||||||
TypeSize size() const*/
|
TypeSize size() const*/
|
||||||
|
|
||||||
_NP_ TypeSize capacity() const
|
public:
|
||||||
{
|
|
||||||
return GetAllHeapSize();
|
|
||||||
}/*
|
|
||||||
_NP_ TypeSize capacity() const*/
|
|
||||||
|
|
||||||
|
|
||||||
_NP_ void ChangeCapacity(TypeSize AI_AddCut)
|
|
||||||
{
|
|
||||||
}/*
|
|
||||||
_NP_ void ChangeCapacity(TypeSize AI_AddCut)*/
|
|
||||||
|
|
||||||
};/*
|
};/*
|
||||||
template<typename TLinkList> class ZtCBody*/
|
template<typename TLinkList> class ZtCBody*/
|
||||||
|
|
||||||
@ -5800,9 +5760,9 @@ namespace ZNsMain
|
|||||||
|
|
||||||
|
|
||||||
TypeData& AddHead()
|
TypeData& AddHead()
|
||||||
{ return AddHeadLink(SendFreeOut())->mo_DataObjt; }
|
{ return **AddHeadLink(SendFreeOut()); }
|
||||||
TypeData& AddTail()
|
TypeData& AddTail()
|
||||||
{ return AddTailLink(SendFreeOut())->mo_DataObjt; }
|
{ return **AddTailLink(SendFreeOut()); }
|
||||||
|
|
||||||
|
|
||||||
TypeData& AddHead(TypeArg AO_ArgData) /*########################*/
|
TypeData& AddHead(TypeArg AO_ArgData) /*########################*/
|
||||||
@ -6087,6 +6047,15 @@ namespace ZNsMain
|
|||||||
TypeSize size() const{ return ml_LinkSize; }
|
TypeSize size() const{ return ml_LinkSize; }
|
||||||
TypeSize GetSize() const{ return ml_LinkSize; }
|
TypeSize GetSize() const{ return ml_LinkSize; }
|
||||||
|
|
||||||
|
_VT_ TypeSize capacity ()
|
||||||
|
{ if(TTypeCRTP::ZEUseCRTP<1) return 0;
|
||||||
|
return GetChildObj().capacity ();
|
||||||
|
}
|
||||||
|
_VT_ TypeSize size_free()
|
||||||
|
{ if(TTypeCRTP::ZEUseCRTP<1) return 0;
|
||||||
|
return GetChildObj().size_free();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void push_front(TypeArg AO_ArgData){AddHead(AO_ArgData);}
|
void push_front(TypeArg AO_ArgData){AddHead(AO_ArgData);}
|
||||||
void push_back (TypeArg AO_ArgData){AddTail(AO_ArgData);}
|
void push_back (TypeArg AO_ArgData){AddTail(AO_ArgData);}
|
||||||
|
@ -1413,10 +1413,14 @@ namespace ZNsMain
|
|||||||
|
|
||||||
TypeSize GetSize () const{return ml_LinkSize;}
|
TypeSize GetSize () const{return ml_LinkSize;}
|
||||||
TypeSize size () const{return ml_LinkSize;}
|
TypeSize size () const{return ml_LinkSize;}
|
||||||
TypeSize capacity() const{return size()+mo_FreeObjt.size();}
|
|
||||||
|
TypeSize capacity() const
|
||||||
|
{ return size()+mo_FreeObjt.size(); }
|
||||||
|
|
||||||
TypeSize GetFreeSize() const
|
TypeSize GetFreeSize() const
|
||||||
{ return mo_FreeObjt.size(); }
|
{ return mo_FreeObjt.size(); }
|
||||||
|
TypeSize size_free () const
|
||||||
|
{ return mo_FreeObjt.size(); }
|
||||||
|
|
||||||
|
|
||||||
ZCLink* GetHeadLinkPtr(){return mp_HeadLink;}
|
ZCLink* GetHeadLinkPtr(){return mp_HeadLink;}
|
||||||
|
@ -2055,28 +2055,17 @@ namespace ZNsMain
|
|||||||
|
|
||||||
|
|
||||||
inline TTypSize GetSize() const
|
inline TTypSize GetSize() const
|
||||||
{
|
{ return ml_LinkSize; }
|
||||||
return ml_LinkSize;
|
inline TTypSize size () const
|
||||||
}/*
|
{ return ml_LinkSize; }
|
||||||
inline TTypSize GetSize() const*/
|
|
||||||
|
|
||||||
inline TTypSize size() const
|
|
||||||
{
|
|
||||||
return ml_LinkSize;
|
|
||||||
}/*
|
|
||||||
inline TTypSize size() const*/
|
|
||||||
|
|
||||||
inline TTypSize capacity() const
|
inline TTypSize capacity() const
|
||||||
{
|
{ return size()+mo_FreeObjt.size(); }
|
||||||
return size()+mo_FreeObjt.size();
|
|
||||||
}/*
|
|
||||||
inline TTypSize capacity() const*/
|
|
||||||
|
|
||||||
inline TypeSize GetFreeSize() const
|
inline TypeSize GetFreeSize() const
|
||||||
{
|
{ return mo_FreeObjt.size(); }
|
||||||
return mo_FreeObjt.size();
|
inline TypeSize size_free () const
|
||||||
}/*
|
{ return mo_FreeObjt.size(); }
|
||||||
inline TypeSize GetFreeSize() const*/
|
|
||||||
|
|
||||||
|
|
||||||
inline bool IsEmpty() const
|
inline bool IsEmpty() const
|
||||||
|
@ -113,6 +113,20 @@ namespace ZNsMain
|
|||||||
|
|
||||||
typedef typename ZCBaseList::ZCLink ZCLink;
|
typedef typename ZCBaseList::ZCLink ZCLink;
|
||||||
|
|
||||||
|
public :
|
||||||
|
|
||||||
|
_VT_ ZTypLong capacity() const
|
||||||
|
{
|
||||||
|
cout<<"** ZCBaseListEx10 : capacity()"<<endl; return 0;
|
||||||
|
}/*
|
||||||
|
_VT_ ZTypLong capacity() const*/
|
||||||
|
|
||||||
|
_VT_ ZTypLong size_free() const
|
||||||
|
{
|
||||||
|
cout<<"** ZCBaseListEx10 : size_free()"<<endl; return 0;
|
||||||
|
}/*
|
||||||
|
_VT_ ZTypLong size_free() const*/
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
_VT_ ZCLink* SendFreeOut()
|
_VT_ ZCLink* SendFreeOut()
|
||||||
@ -204,6 +218,20 @@ namespace ZNsMain
|
|||||||
|
|
||||||
typedef typename ZCBaseList::ZCLink ZCLink;
|
typedef typename ZCBaseList::ZCLink ZCLink;
|
||||||
|
|
||||||
|
public :
|
||||||
|
|
||||||
|
_VT_ ZTypLong capacity() const
|
||||||
|
{
|
||||||
|
cout<<"** ZCBaseListEx11 : capacity()"<<endl; return 0;
|
||||||
|
}/*
|
||||||
|
_VT_ ZTypLong capacity() const*/
|
||||||
|
|
||||||
|
_VT_ ZTypLong size_free() const
|
||||||
|
{
|
||||||
|
cout<<"** ZCBaseListEx11 : size_free()"<<endl; return 0;
|
||||||
|
}/*
|
||||||
|
_VT_ ZTypLong size_free() const*/
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
_VT_ ZCLink* SendFreeOut()
|
_VT_ ZCLink* SendFreeOut()
|
||||||
@ -378,6 +406,9 @@ namespace ZNsMain
|
|||||||
VO_ZCBaseListEx10_2.DeleteHead(1);
|
VO_ZCBaseListEx10_2.DeleteHead(1);
|
||||||
VO_ZCBaseListEx10_2.IterElement(&ShowDataInNode);
|
VO_ZCBaseListEx10_2.IterElement(&ShowDataInNode);
|
||||||
|
|
||||||
|
cout<<"# VO_ZCBaseListEx10 : capacity()="<<VO_ZCBaseListEx10 .capacity()<<endl;
|
||||||
|
cout<<"# VO_ZCBaseListEx10_2 : capacity()="<<VO_ZCBaseListEx10_2.capacity()<<endl;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}/*
|
}/*
|
||||||
static int Main(int AI_ArgCnt=0, char* APP_ArgVal[]=0)*/
|
static int Main(int AI_ArgCnt=0, char* APP_ArgVal[]=0)*/
|
||||||
|
Reference in New Issue
Block a user