Compare commits
2 Commits
a878376507
...
a4c6342573
Author | SHA1 | Date | |
---|---|---|---|
/* User with id == 0 is a fake user from git author */
|
a4c6342573 | ||
/* User with id == 0 is a fake user from git author */
|
af60e817f3 |
@ -2283,6 +2283,165 @@ namespace ZNsMain
|
|||||||
/////////////////////////////////////////////////////////////////////////////*/
|
/////////////////////////////////////////////////////////////////////////////*/
|
||||||
|
|
||||||
|
|
||||||
|
namespace ZNsExam
|
||||||
|
{
|
||||||
|
|
||||||
|
template<typename TDummy=void*> class ZtCExamObjList
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
#ifndef _WIN
|
||||||
|
class CHelpObj
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
CHelpObj()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
CHelpObj(const CHelpObj& rhs)
|
||||||
|
{
|
||||||
|
cout<<"* CHelpObj(const CHelpObj& rhs)"<<endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public:
|
||||||
|
}; CHelpObj VO_CHelpObj; cout<<"VO_CHelpObj Ptr : "<<&VO_CHelpObj<<endl;
|
||||||
|
|
||||||
|
|
||||||
|
struct StFunctor
|
||||||
|
{
|
||||||
|
static void ShowElement(int ArgiValue){cout<<"#1 Value="<<ArgiValue<<endl;}
|
||||||
|
};
|
||||||
|
struct StFunctor2
|
||||||
|
{
|
||||||
|
static void ShowElement(int ArgiValue, CHelpObj)
|
||||||
|
{cout<<"#2 Value="<<ArgiValue<<", CHelpObj Addr=None"<<" With CHelpObj"<<endl;}
|
||||||
|
};
|
||||||
|
struct StFunctor3
|
||||||
|
{
|
||||||
|
static void ShowElement(int ArgiValue, CHelpObj& AR_CHelpObj)
|
||||||
|
{cout<<"#3 Value="<<ArgiValue<<", HelpObj Ptr="<<&AR_CHelpObj<<" With CHelpObj Ref"<<endl;}
|
||||||
|
};
|
||||||
|
struct StFunctor4
|
||||||
|
{
|
||||||
|
static void ShowElement(int ArgiValue, CHelpObj& AR_CHelpObj)
|
||||||
|
{cout<<"#4 Value="<<ArgiValue<<", HelpObj Ptr="<<&AR_CHelpObj<<" With CHelpObj in Ptr"<<endl;}
|
||||||
|
};
|
||||||
|
struct StFunctor5
|
||||||
|
{
|
||||||
|
static void ShowElement(int ArgiValue, CHelpObj& AR_CHelpObj, CHelpObj& AR_CHelpObj2)
|
||||||
|
{cout<<"#5 Value="<<ArgiValue<<", HelpObj Ptr="<<&AR_CHelpObj<<" With CHelpObj Ref 2"<<endl;}
|
||||||
|
};
|
||||||
|
struct StFunctor6
|
||||||
|
{
|
||||||
|
static void ShowElement(int ArgiValue, CHelpObj& AR_CHelpObj, CHelpObj AO_CHelpObj2)
|
||||||
|
{cout<<"#6 Value="<<ArgiValue<<", HelpObj Ptr="<<&AR_CHelpObj<<" With CHelpObj Half Ref"<<endl;}
|
||||||
|
};
|
||||||
|
#endif //!defined(_WIN)
|
||||||
|
|
||||||
|
|
||||||
|
static int Main(int AI_ArgCnt=0, const char* APP_ArgVal[]=0)
|
||||||
|
{
|
||||||
|
using namespace std ;
|
||||||
|
using namespace ZNsMain;
|
||||||
|
|
||||||
|
typedef ZtCObjList<int> CObjList ;
|
||||||
|
typedef CObjList::IterEasy IterEasyL;
|
||||||
|
|
||||||
|
|
||||||
|
CObjList VO_CObjList;
|
||||||
|
|
||||||
|
VO_CObjList.AddTail(10);
|
||||||
|
VO_CObjList.AddTail(20);
|
||||||
|
VO_CObjList.AddTail(30);
|
||||||
|
VO_CObjList.AddTail(40);
|
||||||
|
|
||||||
|
IterEasyL VH_IterL = VO_CObjList.ItHEasy();
|
||||||
|
|
||||||
|
#ifdef _WIN
|
||||||
|
class CHelpObj
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
CHelpObj()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
CHelpObj(const CHelpObj& rhs)
|
||||||
|
{
|
||||||
|
cout<<"* CHelpObj(const CHelpObj& rhs)"<<endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public:
|
||||||
|
}; CHelpObj VO_CHelpObj; cout<<"VO_CHelpObj Ptr : "<<&VO_CHelpObj<<endl;
|
||||||
|
|
||||||
|
|
||||||
|
struct StFunctor
|
||||||
|
{
|
||||||
|
static void ShowElement(int ArgiValue){cout<<"#1 Value="<<ArgiValue<<endl;}
|
||||||
|
};
|
||||||
|
struct StFunctor2
|
||||||
|
{
|
||||||
|
static void ShowElement(int ArgiValue, CHelpObj)
|
||||||
|
{cout<<"#2 Value="<<ArgiValue<<", CHelpObj Addr=None"<<" With CHelpObj"<<endl;}
|
||||||
|
};
|
||||||
|
struct StFunctor3
|
||||||
|
{
|
||||||
|
static void ShowElement(int ArgiValue, CHelpObj& AR_CHelpObj)
|
||||||
|
{cout<<"#3 Value="<<ArgiValue<<", HelpObj Ptr="<<&AR_CHelpObj<<" With CHelpObj Ref"<<endl;}
|
||||||
|
};
|
||||||
|
struct StFunctor4
|
||||||
|
{
|
||||||
|
static void ShowElement(int ArgiValue, CHelpObj& AR_CHelpObj)
|
||||||
|
{cout<<"#4 Value="<<ArgiValue<<", HelpObj Ptr="<<&AR_CHelpObj<<" With CHelpObj in Ptr"<<endl;}
|
||||||
|
};
|
||||||
|
struct StFunctor5
|
||||||
|
{
|
||||||
|
static void ShowElement(int ArgiValue, CHelpObj& AR_CHelpObj, CHelpObj& AR_CHelpObj2)
|
||||||
|
{cout<<"#5 Value="<<ArgiValue<<", HelpObj Ptr="<<&AR_CHelpObj<<" With CHelpObj Ref 2"<<endl;}
|
||||||
|
};
|
||||||
|
struct StFunctor6
|
||||||
|
{
|
||||||
|
static void ShowElement(int ArgiValue, CHelpObj& AR_CHelpObj, CHelpObj AO_CHelpObj2)
|
||||||
|
{cout<<"#6 Value="<<ArgiValue<<", HelpObj Ptr="<<&AR_CHelpObj<<" With CHelpObj Half Ref"<<endl;}
|
||||||
|
};
|
||||||
|
#endif //_WIN
|
||||||
|
|
||||||
|
|
||||||
|
cout<<endl<<"#### Show CObjList Element ####"<<endl<<endl;
|
||||||
|
|
||||||
|
VO_CObjList.IterElement(StFunctor ::ShowElement);
|
||||||
|
VO_CObjList.IterElement(StFunctor2::ShowElement, VO_CHelpObj );
|
||||||
|
VO_CObjList.IterElement(StFunctor3::ShowElement, ZftMCR(VO_CHelpObj) );
|
||||||
|
VO_CObjList.IterElement(StFunctor4::ShowElement, ZftMCP(VO_CHelpObj) );
|
||||||
|
VO_CObjList.IterElement(StFunctor5::ShowElement, ZftMCP(VO_CHelpObj), ZftMCP(VO_CHelpObj) );
|
||||||
|
VO_CObjList.IterElement(StFunctor6::ShowElement, ZftMCP(VO_CHelpObj), VO_CHelpObj );
|
||||||
|
|
||||||
|
/* 위 코드에서 ShowElement() 정의가 Main 함수 안에 있으면,
|
||||||
|
linux g++ 4.4.7 에서 컴파일 에러다. struct StFunctor1
|
||||||
|
등의 정의를 Main() 함수 바깥으로 빼면 된다.
|
||||||
|
*/
|
||||||
|
__for1(int, i, VO_CObjList.size())
|
||||||
|
{
|
||||||
|
cout<<i<<"th value="<<
|
||||||
|
VO_CObjList.ItD(VH_IterL)<<endl;
|
||||||
|
|
||||||
|
VO_CObjList.ItNext(VH_IterL); //////
|
||||||
|
}/*
|
||||||
|
__for1(int, i, VO_CObjList.size())*/
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}/*
|
||||||
|
static int Main(int AI_ArgCnt=0, const char* APP_ArgVal[]=0)*/
|
||||||
|
|
||||||
|
public:
|
||||||
|
};/*
|
||||||
|
template<typename TDummy=void*> class ZtCExamObjList*/
|
||||||
|
|
||||||
|
}/*
|
||||||
|
namespace ZNsExam*/
|
||||||
|
|
||||||
|
|
||||||
namespace ZNsType
|
namespace ZNsType
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -661,7 +661,7 @@ namespace ZNsMain
|
|||||||
namespace ZNsExam
|
namespace ZNsExam
|
||||||
{
|
{
|
||||||
|
|
||||||
template<typename TTypeInt=int> class ZtCSortIntList
|
template<typename TTypeInt=int> class ZtExamSortIntList
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
@ -676,7 +676,7 @@ namespace ZNsMain
|
|||||||
using namespace std; typedef ZNsMain::
|
using namespace std; typedef ZNsMain::
|
||||||
ZtCObjList<TTypeInt, TTypeInt> CObjList ;
|
ZtCObjList<TTypeInt, TTypeInt> CObjList ;
|
||||||
|
|
||||||
CObjList VO_CIntList; //////////////////////////
|
CObjList VO_CIntList; ///////////////////////////
|
||||||
|
|
||||||
VO_CIntList.AddTail(10); VO_CIntList.AddTail(1 );
|
VO_CIntList.AddTail(10); VO_CIntList.AddTail(1 );
|
||||||
VO_CIntList.AddTail(6 ); VO_CIntList.AddTail(4 );
|
VO_CIntList.AddTail(6 ); VO_CIntList.AddTail(4 );
|
||||||
@ -695,7 +695,7 @@ namespace ZNsMain
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
};/*
|
};/*
|
||||||
template<typename TTypeInt=int> class ZtCSortIntList*/
|
template<typename TTypeInt=int> class ZtExamSortIntList*/
|
||||||
|
|
||||||
}/*
|
}/*
|
||||||
namespace ZNsExam*/
|
namespace ZNsExam*/
|
||||||
|
@ -413,7 +413,6 @@ namespace ZNsMain
|
|||||||
typedef typename ZCTypeString::TypeLong TypeLength ;
|
typedef typename ZCTypeString::TypeLong TypeLength ;
|
||||||
public:
|
public:
|
||||||
typedef typename ZCTypeChars ::TypeChar TypeChar ; // TTypCh 과 같은 형이어야 한다.
|
typedef typename ZCTypeChars ::TypeChar TypeChar ; // TTypCh 과 같은 형이어야 한다.
|
||||||
typedef typename ZCTypeChars ::TypeLength TypeLength;
|
|
||||||
typedef typename ZCTypeChars ::ZCChars ZCChars ;
|
typedef typename ZCTypeChars ::ZCChars ZCChars ;
|
||||||
public:
|
public:
|
||||||
typedef TypeChar TypeData ;
|
typedef TypeChar TypeData ;
|
||||||
|
Reference in New Issue
Block a user