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