From f3b886c8c280702cbefc751bdb9e93cd968bb90b Mon Sep 17 00:00:00 2001 From: sauron Date: Wed, 24 Sep 2025 11:20:40 +0900 Subject: [PATCH] commit 2025-09-24 11:20 add ZtCFreeHeapSngl<>::MakeEqual() in ZCppMain/ZtCObjList.H and ZtCSimList.H --- ZCppMain/ZMainHead.H | 18 ++++++++++++++++++ ZCppMain/ZtCObjList.H | 13 +++++++++++++ ZCppMain/ZtCSimList.H | 14 ++++++++++++++ ZCppMainTest/ZtCSimList_000.cpp | 12 ++++++++++++ 4 files changed, 57 insertions(+) diff --git a/ZCppMain/ZMainHead.H b/ZCppMain/ZMainHead.H index eb27ad2..b4c7d71 100644 --- a/ZCppMain/ZMainHead.H +++ b/ZCppMain/ZMainHead.H @@ -3847,6 +3847,12 @@ namespace ZNsMain void DeleteHeap(){} + void MakeEuqal(ZtCBody& rhs) + { + }/* + void MakeEuqal(ZtCBody& rhs)*/ + + TypeSize GetUseHeapSize() const { return 0; @@ -4025,6 +4031,12 @@ namespace ZNsMain void DeleteHeap(){} + void MakeEuqal(ZtCBody& rhs) + { + }/* + void MakeEuqal(ZtCBody& rhs)*/ + + TypeSize GetUseHeapSize() const { return 0; @@ -4165,6 +4177,12 @@ namespace ZNsMain void DeleteHeap(){} + void MakeEuqal(ZtCBody& rhs) + { + }/* + void MakeEuqal(ZtCBody& rhs)*/ + + TypeSize GetUseHeapSize() const { return 0; diff --git a/ZCppMain/ZtCObjList.H b/ZCppMain/ZtCObjList.H index 4711f82..5230a9b 100644 --- a/ZCppMain/ZtCObjList.H +++ b/ZCppMain/ZtCObjList.H @@ -730,6 +730,19 @@ namespace ZNsMain 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 { return ml_UseSize; diff --git a/ZCppMain/ZtCSimList.H b/ZCppMain/ZtCSimList.H index 705898a..fb26f3f 100644 --- a/ZCppMain/ZtCSimList.H +++ b/ZCppMain/ZtCSimList.H @@ -723,6 +723,7 @@ namespace ZNsMain this->ml_AllSize += AI_FetchSize ; this->ml_UseSize += AI_FetchSize ; this->mp_NoUseTail = VP_RhsCutTail; + rhs. ml_AllSize -= AI_FetchSize ; rhs. ml_UseSize -= AI_FetchSize ; rhs. mp_NoUseHead = VP_RhsNewHead; @@ -732,6 +733,19 @@ namespace ZNsMain 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 { return ml_UseSize; diff --git a/ZCppMainTest/ZtCSimList_000.cpp b/ZCppMainTest/ZtCSimList_000.cpp index df6d406..488907a 100644 --- a/ZCppMainTest/ZtCSimList_000.cpp +++ b/ZCppMainTest/ZtCSimList_000.cpp @@ -197,6 +197,18 @@ namespace ZNsMain cout<<"# list10 capacity : " <