commit 2025-09-24 11:20 add ZtCFreeHeapSngl<>::MakeEqual() in ZCppMain/ZtCObjList.H and ZtCSimList.H

This commit is contained in:
2025-09-24 11:20:40 +09:00
parent f58ad91530
commit f3b886c8c2
4 changed files with 57 additions and 0 deletions

View File

@ -3847,6 +3847,12 @@ namespace ZNsMain
void DeleteHeap(){} void DeleteHeap(){}
void MakeEuqal(ZtCBody& rhs)
{
}/*
void MakeEuqal(ZtCBody& rhs)*/
TypeSize GetUseHeapSize() const TypeSize GetUseHeapSize() const
{ {
return 0; return 0;
@ -4025,6 +4031,12 @@ namespace ZNsMain
void DeleteHeap(){} void DeleteHeap(){}
void MakeEuqal(ZtCBody& rhs)
{
}/*
void MakeEuqal(ZtCBody& rhs)*/
TypeSize GetUseHeapSize() const TypeSize GetUseHeapSize() const
{ {
return 0; return 0;
@ -4165,6 +4177,12 @@ namespace ZNsMain
void DeleteHeap(){} void DeleteHeap(){}
void MakeEuqal(ZtCBody& rhs)
{
}/*
void MakeEuqal(ZtCBody& rhs)*/
TypeSize GetUseHeapSize() const TypeSize GetUseHeapSize() const
{ {
return 0; return 0;

View File

@ -730,6 +730,19 @@ namespace ZNsMain
TypeSize Fetch(ZtCBody& rhs, TypeSize AI_FetchSize)*/ TypeSize Fetch(ZtCBody& rhs, TypeSize AI_FetchSize)*/
void MakeEqual(ZtCBody& rhs)
{
// 갯수만 맞춘다.
if(this==&rhs) return;
if(this->size() > rhs.size())
DeleteHeap( this->size() - rhs. size() );
else AddHeap ( rhs. size() - this->size() );
}/*
void MakeEqual(ZtCBody& rhs)*/
TypeSize GetUseHeapSize() const TypeSize GetUseHeapSize() const
{ {
return ml_UseSize; return ml_UseSize;

View File

@ -723,6 +723,7 @@ namespace ZNsMain
this->ml_AllSize += AI_FetchSize ; this->ml_AllSize += AI_FetchSize ;
this->ml_UseSize += AI_FetchSize ; this->ml_UseSize += AI_FetchSize ;
this->mp_NoUseTail = VP_RhsCutTail; this->mp_NoUseTail = VP_RhsCutTail;
rhs. ml_AllSize -= AI_FetchSize ; rhs. ml_AllSize -= AI_FetchSize ;
rhs. ml_UseSize -= AI_FetchSize ; rhs. ml_UseSize -= AI_FetchSize ;
rhs. mp_NoUseHead = VP_RhsNewHead; rhs. mp_NoUseHead = VP_RhsNewHead;
@ -732,6 +733,19 @@ namespace ZNsMain
TypeSize Fetch(ZtCBody& rhs, TypeSize AI_FetchSize)*/ TypeSize Fetch(ZtCBody& rhs, TypeSize AI_FetchSize)*/
void MakeEqual(ZtCBody& rhs)
{
// 갯수만 맞춘다.
if(this==&rhs) return;
if(this->size() > rhs.size())
DeleteHeap( this->size() - rhs. size() );
else AddHeap ( rhs. size() - this->size() );
}/*
void MakeEqual(ZtCBody& rhs)*/
TypeSize GetUseHeapSize() const TypeSize GetUseHeapSize() const
{ {
return ml_UseSize; return ml_UseSize;

View File

@ -197,6 +197,18 @@ namespace ZNsMain
cout<<"# list10 capacity : " <<VO_ListOfStr10.capacity ()<<endl; cout<<"# list10 capacity : " <<VO_ListOfStr10.capacity ()<<endl;
cout<<"# list11 capacity : " <<VO_ListOfStr11.capacity ()<<endl; cout<<"# list11 capacity : " <<VO_ListOfStr11.capacity ()<<endl;
VO_ListOfStr11.GetCFreeHeap().AddHeap(2);
VO_ListOfStr10.GetCFreeHeap().MakeEqual( VO_ListOfStr11.GetCFreeHeap() );
cout<<"# After adding free 2 in list11 and MakeEqual() : list10 and list11"<<endl;
cout<<"# list10 size : " <<VO_ListOfStr10.size ()<<endl;
cout<<"# list11 size : " <<VO_ListOfStr11.size ()<<endl;
cout<<"# list10 free size: " <<VO_ListOfStr10.GetFreeSize ()<<endl;
cout<<"# list11 free size: " <<VO_ListOfStr11.GetFreeSize ()<<endl;
cout<<"# list10 capacity : " <<VO_ListOfStr10.capacity ()<<endl;
cout<<"# list11 capacity : " <<VO_ListOfStr11.capacity ()<<endl;
cout<<"# list11 IterElement ####" <<endl; cout<<"# list11 IterElement ####" <<endl;
{ {
VO_ListOfStr11.IterElement(&ShowDataInNode); VO_ListOfStr11.IterElement(&ShowDataInNode);