hp2FEM
0.1
|
00001 #ifndef _TWOINDEXTABLE_H_ 00002 #define _TWOINDEXTABLE_H_ 00003 // --------------------------------------------- 00004 // company : 00005 // user : 00006 // date : 22 Mar 2015 17:21 00007 // file : TwoIndexTable.h 00008 // markers : Full 00009 // language : C++ 00010 // generator : Metamill 6.0 00011 // --------------------------------------------- 00012 00013 //#UBLK-BEG-HEADERH 00014 //============================================================== 00015 // Description : 00016 //-------------------------------------------------------------- 00017 // Author : Gilberto Luis 00018 // Created : 28 Fev 2011 00019 //-------------------------------------------------------------- 00020 // Change history : 00021 // 28 Fev 2011 (Gilberto Luis) Initial version generated 00022 // 00023 //============================================================== 00024 //#UBLK-END-HEADERH 00025 00026 /*================================================================================================= 00027 = = 00028 = Copyright 2010-2015 Marco Lucio Bittencourt / Fabiano Fernandes Bargos = 00029 = Gilberto Luis Valente / Jorge Luis Suzuki / Allan Patrick Cordeiro Dias = 00030 = = 00031 = Licensed under the Apache License, Version 2.0 (the "License"); = 00032 = you may not use this file except in compliance with the License. = 00033 = You may obtain a copy of the License at = 00034 = = 00035 = http://www.apache.org/licenses/LICENSE-2.0 = 00036 = = 00037 = Unless required by applicable law or agreed to in writing, software = 00038 = distributed under the License is distributed on an "AS IS" BASIS, = 00039 = WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. = 00040 = See the License for the specific language governing permissions and = 00041 = limitations under the License. = 00042 = = 00043 =================================================================================================*/ 00044 00045 00046 #include "ds/BuiltInArray.h" 00047 00048 00054 template <class Type> 00055 class TwoIndexTable 00056 { 00057 //#UBLK-BEG-CLASSDEF mm:9f4400c9-4047-11e0-9e6a-d134ac8dd9fe 00058 //#UBLK-END-CLASSDEF 00059 00060 public: 00061 00062 // METHOD=mm:9f44012e-4047-11e0-9e6a-d134ac8dd9fe 00063 TwoIndexTable(); 00064 00065 // METHOD=mm:9f44012f-4047-11e0-9e6a-d134ac8dd9fe 00066 TwoIndexTable(unsigned long NumberSubRows, unsigned long NumberRow, unsigned long NumberData, Type* Data = 0, unsigned long* RowIndices = 0, unsigned long* SubRowIndices = 0); 00067 00068 // METHOD=mm:9f440134-4047-11e0-9e6a-d134ac8dd9fe 00069 TwoIndexTable(TwoIndexTable& Instance); 00070 00071 // METHOD=mm:9f440135-4047-11e0-9e6a-d134ac8dd9fe 00072 ~TwoIndexTable(); 00073 00074 // METHOD=mm:9f440136-4047-11e0-9e6a-d134ac8dd9fe 00075 TwoIndexTable<Type>& operator=(TwoIndexTable& Instance); 00076 00077 // METHOD=mm:9f440137-4047-11e0-9e6a-d134ac8dd9fe 00078 Type& operator[](unsigned long Index); 00079 00080 // METHOD=mm:9f440138-4047-11e0-9e6a-d134ac8dd9fe 00081 unsigned long& operator()(unsigned long Index); 00082 00083 // METHOD=mm:f1b10720-2771-4c08-b71b-f29e203e4491 00084 unsigned long long SizeOf(); 00085 00086 // METHOD=mm:819d99b5-412e-11e0-9712-92e7e8707e8f 00087 unsigned long GetSubRow(unsigned long RowNumber, unsigned long SubRowNumber); 00088 00089 // METHOD=mm:9f440139-4047-11e0-9e6a-d134ac8dd9fe 00090 operator unsigned long* const(); 00091 00092 // METHOD=mm:9f440140-4047-11e0-9e6a-d134ac8dd9fe 00093 unsigned long* const GetIndices(); 00094 00095 // METHOD=mm:5b77ea33-412e-11e0-9712-92e7e8707e8f 00096 unsigned long* const GetSubRowIndices(); 00097 00098 // METHOD=mm:9f44013e-4047-11e0-9e6a-d134ac8dd9fe 00099 Type* const GetData(); 00100 00101 // METHOD=mm:6837ff9f-5f82-11e0-89bf-82ea5c842841 00102 unsigned long GetRowSize(unsigned long Row); 00103 00104 // METHOD=mm:9f44013f-4047-11e0-9e6a-d134ac8dd9fe 00105 Type* GetRowData(unsigned long Row, unsigned long& RowSize); 00106 00107 // METHOD=mm:095db863-404a-11e0-9e6a-d134ac8dd9fe 00108 Type* GetRowData(unsigned long Row, unsigned long SubRow, unsigned long& SubRowSize); 00109 00110 // METHOD=mm:9f440141-4047-11e0-9e6a-d134ac8dd9fe 00111 unsigned long GetDataSize(); 00112 00113 // METHOD=mm:9f440142-4047-11e0-9e6a-d134ac8dd9fe 00114 unsigned long GetRowIndicesSize(); 00115 00116 // METHOD=mm:40d65c33-4b1e-11e0-89d2-9f1d226375a1 00117 unsigned long GetNumberSubRow(); 00118 00119 // METHOD=mm:15258481-4134-11e0-9712-92e7e8707e8f 00120 unsigned long GetSubRowsSize(); 00121 00122 // METHOD=mm:54dc1849-4673-11e0-8a89-f694fab9292a 00123 unsigned long GetSubRowSize(unsigned long RowNumber, unsigned long SubRowNumber); 00124 00125 // METHOD=mm:9f440143-4047-11e0-9e6a-d134ac8dd9fe 00126 void SetSize(unsigned long NumberSubRows = 0, unsigned long NumberRow = 0, unsigned long NumberData = 0, Type* Data = 0, unsigned long* RowIndices = 0, unsigned long* SubRowIndices = 0); 00127 00128 // METHOD=mm:9f440148-4047-11e0-9e6a-d134ac8dd9fe 00129 void NewRow(Type* RowData, unsigned long RowSize, unsigned long* SubRows); 00130 00131 // METHOD=mm:9f440149-4047-11e0-9e6a-d134ac8dd9fe 00132 void SetRow(unsigned long RowNumber, Type* RowData, unsigned long* SubRows = 0); 00133 00134 // METHOD=mm:9f44014b-4047-11e0-9e6a-d134ac8dd9fe 00135 void Print(FILE* File, char* Format, char* Message = ""); 00136 00137 // METHOD=mm:9f44014c-4047-11e0-9e6a-d134ac8dd9fe 00138 void Save(FILE* File); 00139 00140 // METHOD=mm:9f44014d-4047-11e0-9e6a-d134ac8dd9fe 00141 void Save(char* TabName, int Version, char* Filename); 00142 00143 // METHOD=mm:fe98b44e-6c88-4ac9-a146-974adaa18253 00144 void Reset(); 00145 00146 // METHOD=mm:9f440152-4047-11e0-9e6a-d134ac8dd9fe 00147 void Restore(FILE* File); 00148 00149 // METHOD=mm:9f440153-4047-11e0-9e6a-d134ac8dd9fe 00150 void Restore(char* TabName, int Version, char* Filename); 00151 00152 // METHOD=mm:9f440154-4047-11e0-9e6a-d134ac8dd9fe 00153 void Free(); 00154 00155 00156 protected: 00157 00158 private: 00159 00160 // METHOD=mm:9f440155-4047-11e0-9e6a-d134ac8dd9fe 00161 void Alloc(unsigned long NumberSubRows, unsigned long NumberRow, unsigned long NumberData, Type* Data, unsigned long* RowIndices, unsigned long* SubRowIndices); 00162 00163 00164 // attr=mm:9f44012c-4047-11e0-9e6a-d134ac8dd9fe 00165 BuiltInArray<Type> DataArray; 00166 // attr=mm:9f44012d-4047-11e0-9e6a-d134ac8dd9fe 00167 BuiltInArray<unsigned long> RowIndicesArray; 00168 // attr=mm:b4b92abd-4047-11e0-9e6a-d134ac8dd9fe 00169 BuiltInArray<unsigned long> SubRowIndicesArray; 00170 // attr=mm:0c7012c3-4672-11e0-8a89-f694fab9292a 00171 unsigned long NumberSubRow; 00172 00173 00174 //#UBLK-BEG-CLASSMEMB mm:9f4400c9-4047-11e0-9e6a-d134ac8dd9fe 00175 //#UBLK-END-CLASSMEMB 00176 }; 00177 00178 00179 // template implementation 00180 #include "TwoIndexTable.cpp" 00181 00182 00183 //#UBLK-BEG-GLOBALH 00184 //*** Removed methods: 03 Mar 2011 21:35 00185 //--- 00186 //uuid=mm:c996c76d-4049-11e0-9e6a-d134ac8dd9fe 00187 // unsigned long* const GetSteps(); 00188 00189 //#UBLK-END-GLOBALH 00190 00191 00192 #endif // _TWOINDEXTABLE_H_