//-------------------------------------------------------------------------------------------------------+ // Copyright (C), 1998-2007, Beijing Tangent Software Co. Ltd. // = FileName : TSqTable2 模板类 // = Version : ver2.0 // = Author : wlw // = CreateDate : 2002-09-09 // = Description: TSqTable2 声明二维数组,可以视为具有无限行列的矩阵 // = Maintainers: // //-------------------------------------------------------------------------------------------------------+ #ifndef _TSQTABLE2_H_ #define _TSQTABLE2_H_ #ifndef _TSQPTABLE_H_ #include "TSqPTable.h" #endif template class TSqTable2 : public TSqPTable< TSqTable > { public: TSqTable2(long rowNum = 0, long colNum = 0); ~TSqTable2(){} void Realloc(long rowNum, long colNum, bool bCopy = true); void SetAll(const T& t); }; template TSqTable2::TSqTable2(long rowNum,long colNum) { Realloc(rowNum,colNum,false); } template void TSqTable2::Realloc(long rowNum,long colNum,bool bCopy) { TSqPTable< TSqTable >::SetLength(rowNum,bCopy); for(this->MoveToFirst();!this->IsOut();this->MoveToNext()) { this->GetCurData().SetLength(colNum,bCopy); } } template void TSqTable2::SetAll(const T&t) { for(this->MoveToFirst();!this->IsOut();this->MoveToNext()) { this->GetCurData().SetAll(t); } } #endif