commit 2025-09-01 00:27 edit a bit ZCppMain/ZMainHead.H
This commit is contained in:
@ -781,65 +781,65 @@ namespace ZNsMain
|
|||||||
넘어가게 하고 싶을 때 사용한다. class ZtCCheckRef 에서 사용하고 있다.
|
넘어가게 하고 싶을 때 사용한다. class ZtCCheckRef 에서 사용하고 있다.
|
||||||
-- 2021-04-10 16:15
|
-- 2021-04-10 16:15
|
||||||
*/
|
*/
|
||||||
template<typename ZtpType> class ZtCRef
|
template<typename TTypType> class ZtCRef
|
||||||
{
|
{
|
||||||
public :
|
public :
|
||||||
typedef ZtpType& TypeData ;
|
typedef TTypType& TypeData ;
|
||||||
typedef ZtpType& TypeRef ;
|
typedef TTypType& TypeRef ;
|
||||||
typedef ZtpType TypeRaw ;
|
typedef TTypType TypeRaw ;
|
||||||
typedef ZtpType TypeConst;
|
typedef TTypType TypeConst;
|
||||||
private:
|
private:
|
||||||
TypeData mr_Data;
|
TypeData mr_Data;
|
||||||
public :
|
public :
|
||||||
ZtCRef(TypeData ZArTypeData) : mr_Data(ZArTypeData){}
|
ZtCRef(TypeData AR_TypeData) : mr_Data(AR_TypeData){}
|
||||||
public :
|
public :
|
||||||
TypeData GetData(){return mr_Data;}
|
TypeData GetData(){return mr_Data;}
|
||||||
public :
|
public :
|
||||||
};/*
|
};/*
|
||||||
template<typename ZtpType> class ZtCRef*/
|
template<typename TTypType> class ZtCRef*/
|
||||||
|
|
||||||
template<typename ZtpType> class ZtCRef<ZtpType&>
|
template<typename TTypType> class ZtCRef<TTypType&>
|
||||||
{
|
{
|
||||||
public :
|
public :
|
||||||
typedef ZtpType& TypeData ;
|
typedef TTypType& TypeData ;
|
||||||
typedef ZtpType& TypeRef ;
|
typedef TTypType& TypeRef ;
|
||||||
typedef ZtpType TypeRaw ;
|
typedef TTypType TypeRaw ;
|
||||||
typedef const ZtpType& TypeConst;
|
typedef const TTypType& TypeConst;
|
||||||
private:
|
private:
|
||||||
TypeRaw& mr_Data;
|
TypeRaw& mr_Data;
|
||||||
public :
|
public :
|
||||||
ZtCRef(TypeRef ZArTypeData) : mr_Data(ZArTypeData){}
|
ZtCRef(TypeRef AR_TypeData) : mr_Data(AR_TypeData){}
|
||||||
public :
|
public :
|
||||||
TypeRef GetData(){return mr_Data;}
|
TypeRef GetData(){return mr_Data;}
|
||||||
public :
|
public :
|
||||||
};/*
|
};/*
|
||||||
template<typename ZtpType> class ZtCRef<ZtpType&>*/
|
template<typename TTypType> class ZtCRef<TTypType&>*/
|
||||||
|
|
||||||
template<typename ZtpType> class ZtCRef<const ZtpType&>
|
template<typename TTypType> class ZtCRef<const TTypType&>
|
||||||
{
|
{
|
||||||
public :
|
public :
|
||||||
typedef const ZtpType& TypeData ;
|
typedef const TTypType& TypeData ;
|
||||||
typedef const ZtpType& TypeRef ;
|
typedef const TTypType& TypeRef ;
|
||||||
typedef const ZtpType TypeRaw ;
|
typedef const TTypType TypeRaw ;
|
||||||
typedef const ZtpType& TypeConst;
|
typedef const TTypType& TypeConst;
|
||||||
private:
|
private:
|
||||||
TypeRaw& mr_Data;
|
TypeRaw& mr_Data;
|
||||||
public :
|
public :
|
||||||
ZtCRef(TypeRef ZArTypeData) : mr_Data(ZArTypeData){}
|
ZtCRef(TypeRef AR_TypeData) : mr_Data(AR_TypeData){}
|
||||||
public :
|
public :
|
||||||
TypeRef GetData(){return mr_Data;}
|
TypeRef GetData(){return mr_Data;}
|
||||||
public :
|
public :
|
||||||
};/*
|
};/*
|
||||||
template<typename ZtpType> class ZtCRef<const ZtpType&>*/
|
template<typename TTypType> class ZtCRef<const TTypType&>*/
|
||||||
|
|
||||||
|
|
||||||
template<typename ZtpType> inline ZtCRef<ZtpType>
|
template<typename TTypType> inline ZtCRef<TTypType>
|
||||||
ZftMakeCRef(ZtpType& ZArTypeData){ return ZtCRef<ZtpType> (ZArTypeData );}
|
ZftMakeCRef(TTypType& AR_TypeData){ return ZtCRef<TTypType> (AR_TypeData );}
|
||||||
template<typename ZtpType> inline ZtCRef<ZtpType>*
|
template<typename TTypType> inline ZtCRef<TTypType>*
|
||||||
ZftMakeCPtr(ZtpType& ZArTypeData){ return (ZtCRef<ZtpType>*)(&ZArTypeData);}
|
ZftMakeCPtr(TTypType& AR_TypeData){ return (ZtCRef<TTypType>*)(&AR_TypeData);}
|
||||||
/*//////////////////////////////////////////////////////////////////////////////
|
/*////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
■ ZftMakeCPtr() 은 인수 ZArTypeData 이 ZtCRef<ZtpType>* 인 것처럼 반환한다.
|
■ ZftMakeCPtr() 은 인수 AR_TypeData 이 ZtCRef<TTypType>* 인 것처럼 반환한다.
|
||||||
|
|
||||||
그래서 template<typename TType> class ZtCCheckRef< ZtCRef<TType>* > 에서 사용할
|
그래서 template<typename TType> class ZtCCheckRef< ZtCRef<TType>* > 에서 사용할
|
||||||
것이다.
|
것이다.
|
||||||
@ -850,11 +850,11 @@ namespace ZNsMain
|
|||||||
|
|
||||||
■ 아래 ZftMCR() 와 ZftMCP() 는 위 함수명을 더 축약한 것이다. -- 2025-08-07 17:41
|
■ 아래 ZftMCR() 와 ZftMCP() 는 위 함수명을 더 축약한 것이다. -- 2025-08-07 17:41
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////*/
|
////////////////////////////////////////////////////////////////////////////////*/
|
||||||
template<typename ZtpType> inline ZtCRef<ZtpType>
|
template<typename TTypType> inline ZtCRef<TTypType>
|
||||||
ZftMCR(ZtpType& ZArTypeData){ return ZtCRef<ZtpType> (ZArTypeData );}
|
ZftMCR(TTypType& AR_TypeData){ return ZtCRef<TTypType> (AR_TypeData );}
|
||||||
template<typename ZtpType> inline ZtCRef<ZtpType>*
|
template<typename TTypType> inline ZtCRef<TTypType>*
|
||||||
ZftMCP(ZtpType& ZArTypeData){ return (ZtCRef<ZtpType>*)(&ZArTypeData);}
|
ZftMCP(TTypType& AR_TypeData){ return (ZtCRef<TTypType>*)(&AR_TypeData);}
|
||||||
|
|
||||||
|
|
||||||
/* template 인수에 ZtCRef 가 있으면, 해당 값을 참조로 인식하고
|
/* template 인수에 ZtCRef 가 있으면, 해당 값을 참조로 인식하고
|
||||||
@ -907,11 +907,11 @@ namespace ZNsMain
|
|||||||
|
|
||||||
아래 함수
|
아래 함수
|
||||||
|
|
||||||
template<typename ZtpType> inline ZtCRef<ZtpType>*
|
template<typename TTypType> inline ZtCRef<TTypType>*
|
||||||
ZftMakeCPtr(ZtpType& ZArTypeData){ return (ZtCRef<ZtpType>*)(&ZArTypeData);}
|
ZftMakeCPtr(TTypType& AR_TypeData){ return (ZtCRef<TTypType>*)(&AR_TypeData);}
|
||||||
|
|
||||||
를 통해, 생성된 포인터에 대해서, 정적 멤버 PassData() 로
|
를 통해, 생성된 포인터에 대해서, 정적 멤버 PassData() 로
|
||||||
TypeRaw* 로 강제변환하고 있다. 그래서 ZtCRef<ZtpType> 객
|
TypeRaw* 로 강제변환하고 있다. 그래서 ZtCRef<TTypType> 객
|
||||||
체의 생성없이 TypeRaw 를 참조로 다룰려고 하는 것이다.
|
체의 생성없이 TypeRaw 를 참조로 다룰려고 하는 것이다.
|
||||||
|
|
||||||
-- 2025=08-07 17:19
|
-- 2025=08-07 17:19
|
||||||
@ -942,7 +942,7 @@ namespace ZNsMain
|
|||||||
{
|
{
|
||||||
public: enum {ZEConstRef = 0};
|
public: enum {ZEConstRef = 0};
|
||||||
};/*
|
};/*
|
||||||
template<typename ZtpType> class ZtCRef*/
|
template<typename TType> class ZtCCheckConstRef*/
|
||||||
|
|
||||||
template<typename TType> class ZtCCheckConstRef<const TType&>
|
template<typename TType> class ZtCCheckConstRef<const TType&>
|
||||||
{
|
{
|
||||||
|
@ -224,16 +224,16 @@ namespace ZNsMain
|
|||||||
}/*
|
}/*
|
||||||
bool IsFullNode() const*/
|
bool IsFullNode() const*/
|
||||||
|
|
||||||
typename ZtCRef<TTypArg>::TypeConst GetData() const
|
typename ZtCRef<TypeArg>::TypeConst GetData() const
|
||||||
{
|
{
|
||||||
return mo_Data;
|
return mo_Data;
|
||||||
}/*
|
}/*
|
||||||
typename ZtCRef<TTypArg>::TypeConst GetData() const*/
|
typename ZtCRef<TypeArg>::TypeConst GetData() const*/
|
||||||
|
|
||||||
|
|
||||||
bool operator==(TTypArg AR_Type) const{return mo_Data==AR_Type;}
|
bool operator==(TypeArg AR_Type) const{return mo_Data==AR_Type;}
|
||||||
bool operator> (TTypArg AR_Type) const{return mo_Data> AR_Type;}
|
bool operator> (TypeArg AR_Type) const{return mo_Data> AR_Type;}
|
||||||
bool operator< (TTypArg AR_Type) const{return mo_Data< AR_Type;}
|
bool operator< (TypeArg AR_Type) const{return mo_Data< AR_Type;}
|
||||||
|
|
||||||
template<typename TFunctor> static void IterInOrder (ZCNode* AP_Node, TFunctor AO_Functor)
|
template<typename TFunctor> static void IterInOrder (ZCNode* AP_Node, TFunctor AO_Functor)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user