Files
envi-code/SourceCode/Code2026/tg_shs/inc/geo/TSqTable2.h
T
gjm 164968b62e chore
把非utf8-bom编码的cpp/h文件改为 utf8 bom 编码, msvc识别utf8编码时,如果不是bom格式的,会使用当前cp_oem来解码.
2026-10-04 00:04:20 +08:00

55 lines
1.3 KiB
C++

//-------------------------------------------------------------------------------------------------------+
// 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 T> class TSqTable2 : public TSqPTable< TSqTable<T> >
{
public:
TSqTable2(long rowNum = 0, long colNum = 0);
~TSqTable2(){}
void Realloc(long rowNum, long colNum, bool bCopy = true);
void SetAll(const T& t);
};
template<class T>
TSqTable2<T>::TSqTable2(long rowNum,long colNum)
{
Realloc(rowNum,colNum,false);
}
template<class T>
void TSqTable2<T>::Realloc(long rowNum,long colNum,bool bCopy)
{
TSqPTable< TSqTable<T> >::SetLength(rowNum,bCopy);
for(this->MoveToFirst();!this->IsOut();this->MoveToNext())
{
this->GetCurData().SetLength(colNum,bCopy);
}
}
template<class T>
void TSqTable2<T>::SetAll(const T&t)
{
for(this->MoveToFirst();!this->IsOut();this->MoveToNext())
{
this->GetCurData().SetAll(t);
}
}
#endif