diff --git a/ZCppMain/ZMainHead.H b/ZCppMain/ZMainHead.H index 2cb5c29..6487d28 100644 --- a/ZCppMain/ZMainHead.H +++ b/ZCppMain/ZMainHead.H @@ -2896,23 +2896,23 @@ namespace ZNsMain 크면 포인터로 넘겨야 하는데, 이러면 어느 object 의 포인터인지 알 수 있지만 그 object 에 속한 enum 형이나 typedef 선언 및 기타 자료 형은 알 수 없다. 그래서 object 의 포인터를 포장하는 클래스 템플릿 - ZtCObjectPtr<> 을 설계한다. + ZtCObjPtr<> 을 설계한다. - ■ typedef ZtCStringBase CStringBase; - typedef ZtCObjectPtr CObjectPtr ; + ■ typedef ZtCStringBase CStringBase; + typedef ZtCObjPtr CObjectPtr ; - 라는 선언이 있으면 CStringBase::TTypeChar 에 접근할 때에는 + 라는 선언이 있으면 CStringBase::TypeChar 에 접근할 때에는 - CObjectPtr::TypeData::TTypeChar 로 하면 된다. + CObjectPtr::TypeData::TypeChar 로 하면 된다. - ■ 포인터 자료형에 대하여 ZtCObjectPtr<> 대신 더 간단하게 + ■ 포인터 자료형에 대하여 ZtCObjPtr<> 대신 더 간단하게 ZtCTypeData<> 를 사용해도 된다. 이 편이 오히려 낳을 것 같다. -- 2010-01-24 22:25:00 //////////////////////////////////////////////////////////////////*/ - template class ZtCObjectPtr + template class ZtCObjPtr { public : typedef TType TypeData; @@ -2920,7 +2920,7 @@ namespace ZNsMain TType& mr_TypeData; public : - ZtCObjectPtr(TType& AR_CData) : mr_TypeData(AR_CData){} + ZtCObjPtr(TType& AR_CData) : mr_TypeData(AR_CData){} TypeData* operator->(){return &mr_TypeData;} TypeData& operator* (){return mr_TypeData;} @@ -2928,7 +2928,7 @@ namespace ZNsMain public : };/* - template class ZtCObjectPtr */ + template class ZtCObjPtr */ /*/////////////////////////////////////////////////////////// @@ -2941,7 +2941,7 @@ namespace ZNsMain template< typename TType, typename TAllocClass=ZCAllocClass > - class ZtCObjectNew : public TAllocClass ///////////////////// + class ZtCObjNew : public TAllocClass //////////////////////// { public : typedef TType TypeData ; @@ -2961,28 +2961,28 @@ namespace ZNsMain StTypeRefCnt* mp_StTypeRefCnt; public : - ZtCObjectNew() + ZtCObjNew() { mp_StTypeRefCnt = (StTypeRefCnt*) - this->ZCAllocator::NewMem( sizeof(StTypeRefCnt) ); + this->ZCAllocator::NewMem(sizeof(StTypeRefCnt)); mp_StTypeRefCnt->MI_RefCount = 1 ; new(&mp_StTypeRefCnt->MO_TypeData) TypeData; }/* - ZtCObjectNew()*/ + ZtCObjNew()*/ - ZtCObjectNew(const TypeData& AR_TypeData) + ZtCObjNew(const TypeData& AR_TypeData) { mp_StTypeRefCnt = (StTypeRefCnt*) - this->ZCAllocator::NewMem( sizeof(StTypeRefCnt) ); + this->ZCAllocator::NewMem(sizeof(StTypeRefCnt)); mp_StTypeRefCnt->MI_RefCount = 1 ; new(&mp_StTypeRefCnt->MO_TypeData) TypeData(AR_TypeData); }/* - ZtCObjectNew(const TypeData& AR_TypeData)*/ + ZtCObjNew(const TypeData& AR_TypeData)*/ template - ZtCObjectNew(TTypeArg1& ArTTypeArg1, TTypeArg2& ArTTypeArg2) + ZtCObjNew(TTypeArg1& ArTTypeArg1, TTypeArg2& ArTTypeArg2) { mp_StTypeRefCnt = (StTypeRefCnt*) this->ZCAllocator::NewMem(sizeof(StTypeRefCnt)); @@ -2992,22 +2992,23 @@ namespace ZNsMain TypeData(ArTTypeArg1, ArTTypeArg2); }/* template - ZtCObjectNew(TTypeArg1& ArTTypeArg1, TTypeArg2& ArTTypeArg2))*/ + ZtCObjNew(TTypeArg1& ArTTypeArg1, TTypeArg2& ArTTypeArg2))*/ - ZtCObjectNew(const ZtCObjectNew& rhs) + ZtCObjNew(const ZtCObjNew& rhs) { - mp_StTypeRefCnt = rhs.mp_StTypeRefCnt; ++mp_StTypeRefCnt->MI_RefCount; + mp_StTypeRefCnt = rhs.mp_StTypeRefCnt ; + ++mp_StTypeRefCnt->MI_RefCount ; }/* - ZtCObjectNew(const ZtCObjectNew& rhs)*/ + ZtCObjNew(const ZtCObjNew& rhs)*/ - ~ZtCObjectNew() + ~ZtCObjNew() { if(--mp_StTypeRefCnt->MI_RefCount <= 0) this->ZCAllocator::DeleteMem(mp_StTypeRefCnt); }/* - ~ZtCObjectNew()*/ + ~ZtCObjNew()*/ - ZtCObjectNew& operator=(const ZtCObjectNew& rhs) + ZtCObjNew& operator=(const ZtCObjNew& rhs) { if(this==&rhs || mp_StTypeRefCnt==rhs.mp_StTypeRefCnt) { return *this; } @@ -3018,7 +3019,7 @@ namespace ZNsMain rhs.mp_StTypeRefCnt->MO_TypeData; return *this; #else if(--mp_StTypeRefCnt->MI_RefCount <= 0) - this->ZCAllocator::DeleteMem( mp_StTypeRefCnt ); + this->ZCAllocator::DeleteMem(mp_StTypeRefCnt); mp_StTypeRefCnt = rhs.mp_StTypeRefCnt ; ++mp_StTypeRefCnt->MI_RefCount ; @@ -3026,15 +3027,15 @@ namespace ZNsMain return *this; ///////////////////////// #endif }/* - ZtCObjectNew& operator=(const ZtCObjectNew& rhs)*/ + ZtCObjNew& operator=(const ZtCObjNew& rhs)*/ - ZtCObjectNew& operator=(const TypeData& AR_TypeData) + ZtCObjNew& operator=(const TypeData& AR_TypeData) { if(&mp_StTypeRefCnt->MO_TypeData==&AR_TypeData) return *this; mp_StTypeRefCnt->MO_TypeData = AR_TypeData; return *this; }/* - ZtCObjectNew& operator=(const TypeData& AR_TypeData)*/ + ZtCObjNew& operator=(const TypeData& AR_TypeData)*/ TypeData& operator* (){return mp_StTypeRefCnt->MO_TypeData;} TypeData* operator->(){return &mp_StTypeRefCnt->MO_TypeData;} @@ -3048,7 +3049,7 @@ namespace ZNsMain };/* template< typename TType, typename TAllocClass=ZCAllocClass > - class ZtCObjectNew : public TAllocClass ///////////////////*/ + class ZtCObjNew : public TAllocClass //////////////////////*/ #ifdef _DEBUG @@ -4393,7 +4394,7 @@ namespace ZNsCPP */ -- 2013-07-09 23:44:00 - new 나 new[] 로 생성되는 일이 아예 없어야겠다. 즉 ZtCObjectNew<> 나 CArray_T<> 등의 클래스 를 사용해야 한다. + new 나 new[] 로 생성되는 일이 아예 없어야겠다. 즉 ZtCObjNew<> 나 CArray_T<> 등의 클래스 를 사용해야 한다. -- 2013-07-11 01:26:00