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 에서 사용하고 있다.
|
||||
-- 2021-04-10 16:15
|
||||
*/
|
||||
template<typename ZtpType> class ZtCRef
|
||||
template<typename TTypType> class ZtCRef
|
||||
{
|
||||
public :
|
||||
typedef ZtpType& TypeData ;
|
||||
typedef ZtpType& TypeRef ;
|
||||
typedef ZtpType TypeRaw ;
|
||||
typedef ZtpType TypeConst;
|
||||
typedef TTypType& TypeData ;
|
||||
typedef TTypType& TypeRef ;
|
||||
typedef TTypType TypeRaw ;
|
||||
typedef TTypType TypeConst;
|
||||
private:
|
||||
TypeData mr_Data;
|
||||
public :
|
||||
ZtCRef(TypeData ZArTypeData) : mr_Data(ZArTypeData){}
|
||||
ZtCRef(TypeData AR_TypeData) : mr_Data(AR_TypeData){}
|
||||
public :
|
||||
TypeData GetData(){return mr_Data;}
|
||||
public :
|
||||
};/*
|
||||
template<typename ZtpType> class ZtCRef*/
|
||||
template<typename TTypType> class ZtCRef*/
|
||||
|
||||
template<typename ZtpType> class ZtCRef<ZtpType&>
|
||||
template<typename TTypType> class ZtCRef<TTypType&>
|
||||
{
|
||||
public :
|
||||
typedef ZtpType& TypeData ;
|
||||
typedef ZtpType& TypeRef ;
|
||||
typedef ZtpType TypeRaw ;
|
||||
typedef const ZtpType& TypeConst;
|
||||
typedef TTypType& TypeData ;
|
||||
typedef TTypType& TypeRef ;
|
||||
typedef TTypType TypeRaw ;
|
||||
typedef const TTypType& TypeConst;
|
||||
private:
|
||||
TypeRaw& mr_Data;
|
||||
public :
|
||||
ZtCRef(TypeRef ZArTypeData) : mr_Data(ZArTypeData){}
|
||||
ZtCRef(TypeRef AR_TypeData) : mr_Data(AR_TypeData){}
|
||||
public :
|
||||
TypeRef GetData(){return mr_Data;}
|
||||
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 :
|
||||
typedef const ZtpType& TypeData ;
|
||||
typedef const ZtpType& TypeRef ;
|
||||
typedef const ZtpType TypeRaw ;
|
||||
typedef const ZtpType& TypeConst;
|
||||
typedef const TTypType& TypeData ;
|
||||
typedef const TTypType& TypeRef ;
|
||||
typedef const TTypType TypeRaw ;
|
||||
typedef const TTypType& TypeConst;
|
||||
private:
|
||||
TypeRaw& mr_Data;
|
||||
public :
|
||||
ZtCRef(TypeRef ZArTypeData) : mr_Data(ZArTypeData){}
|
||||
ZtCRef(TypeRef AR_TypeData) : mr_Data(AR_TypeData){}
|
||||
public :
|
||||
TypeRef GetData(){return mr_Data;}
|
||||
public :
|
||||
};/*
|
||||
template<typename ZtpType> class ZtCRef<const ZtpType&>*/
|
||||
template<typename TTypType> class ZtCRef<const TTypType&>*/
|
||||
|
||||
|
||||
template<typename ZtpType> inline ZtCRef<ZtpType>
|
||||
ZftMakeCRef(ZtpType& ZArTypeData){ return ZtCRef<ZtpType> (ZArTypeData );}
|
||||
template<typename ZtpType> inline ZtCRef<ZtpType>*
|
||||
ZftMakeCPtr(ZtpType& ZArTypeData){ return (ZtCRef<ZtpType>*)(&ZArTypeData);}
|
||||
/*//////////////////////////////////////////////////////////////////////////////
|
||||
template<typename TTypType> inline ZtCRef<TTypType>
|
||||
ZftMakeCRef(TTypType& AR_TypeData){ return ZtCRef<TTypType> (AR_TypeData );}
|
||||
template<typename TTypType> inline ZtCRef<TTypType>*
|
||||
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>* > 에서 사용할
|
||||
것이다.
|
||||
@ -850,11 +850,11 @@ namespace ZNsMain
|
||||
|
||||
■ 아래 ZftMCR() 와 ZftMCP() 는 위 함수명을 더 축약한 것이다. -- 2025-08-07 17:41
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////*/
|
||||
template<typename ZtpType> inline ZtCRef<ZtpType>
|
||||
ZftMCR(ZtpType& ZArTypeData){ return ZtCRef<ZtpType> (ZArTypeData );}
|
||||
template<typename ZtpType> inline ZtCRef<ZtpType>*
|
||||
ZftMCP(ZtpType& ZArTypeData){ return (ZtCRef<ZtpType>*)(&ZArTypeData);}
|
||||
////////////////////////////////////////////////////////////////////////////////*/
|
||||
template<typename TTypType> inline ZtCRef<TTypType>
|
||||
ZftMCR(TTypType& AR_TypeData){ return ZtCRef<TTypType> (AR_TypeData );}
|
||||
template<typename TTypType> inline ZtCRef<TTypType>*
|
||||
ZftMCP(TTypType& AR_TypeData){ return (ZtCRef<TTypType>*)(&AR_TypeData);}
|
||||
|
||||
|
||||
/* template 인수에 ZtCRef 가 있으면, 해당 값을 참조로 인식하고
|
||||
@ -907,11 +907,11 @@ namespace ZNsMain
|
||||
|
||||
아래 함수
|
||||
|
||||
template<typename ZtpType> inline ZtCRef<ZtpType>*
|
||||
ZftMakeCPtr(ZtpType& ZArTypeData){ return (ZtCRef<ZtpType>*)(&ZArTypeData);}
|
||||
template<typename TTypType> inline ZtCRef<TTypType>*
|
||||
ZftMakeCPtr(TTypType& AR_TypeData){ return (ZtCRef<TTypType>*)(&AR_TypeData);}
|
||||
|
||||
를 통해, 생성된 포인터에 대해서, 정적 멤버 PassData() 로
|
||||
TypeRaw* 로 강제변환하고 있다. 그래서 ZtCRef<ZtpType> 객
|
||||
TypeRaw* 로 강제변환하고 있다. 그래서 ZtCRef<TTypType> 객
|
||||
체의 생성없이 TypeRaw 를 참조로 다룰려고 하는 것이다.
|
||||
|
||||
-- 2025=08-07 17:19
|
||||
@ -942,7 +942,7 @@ namespace ZNsMain
|
||||
{
|
||||
public: enum {ZEConstRef = 0};
|
||||
};/*
|
||||
template<typename ZtpType> class ZtCRef*/
|
||||
template<typename TType> class ZtCCheckConstRef*/
|
||||
|
||||
template<typename TType> class ZtCCheckConstRef<const TType&>
|
||||
{
|
||||
|
@ -224,16 +224,16 @@ namespace ZNsMain
|
||||
}/*
|
||||
bool IsFullNode() const*/
|
||||
|
||||
typename ZtCRef<TTypArg>::TypeConst GetData() const
|
||||
typename ZtCRef<TypeArg>::TypeConst GetData() const
|
||||
{
|
||||
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> (TTypArg 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> (TypeArg 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)
|
||||
{
|
||||
|
Reference in New Issue
Block a user