hp2FEM
0.1
|
00001 #ifndef _ONEINDEXTABLE_H_ 00002 #define _ONEINDEXTABLE_H_ 00003 // --------------------------------------------- 00004 // company : 00005 // user : 00006 // date : 22 Mar 2015 17:21 00007 // file : OneIndexTable.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 : 01 Mar 2011 00019 //-------------------------------------------------------------- 00020 // Change history : 00021 // 01 Mar 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 00055 template <class Type> 00056 class OneIndexTable 00057 { 00058 //#UBLK-BEG-CLASSDEF mm:2799887c-3ec4-11e0-8408-f25596bc45f2 00059 //#UBLK-END-CLASSDEF 00060 00061 public: 00062 00063 // METHOD=mm:249e9caf-3ec4-11e0-8408-f25596bc45f2 00064 OneIndexTable(); 00065 00066 // METHOD=mm:249e9cb0-3ec4-11e0-8408-f25596bc45f2 00067 OneIndexTable(unsigned long RowNumber, unsigned long DataNumber, Type* Data = 0, unsigned long* Indices = 0); 00068 00069 // METHOD=mm:249e9cb1-3ec4-11e0-8408-f25596bc45f2 00070 OneIndexTable(OneIndexTable& Instance); 00071 00072 // METHOD=mm:249e9cb6-3ec4-11e0-8408-f25596bc45f2 00073 ~OneIndexTable(); 00074 00075 // METHOD=mm:249e9cb7-3ec4-11e0-8408-f25596bc45f2 00076 OneIndexTable<Type>& operator=(OneIndexTable& Instance); 00077 00078 // METHOD=mm:249e9cb8-3ec4-11e0-8408-f25596bc45f2 00079 Type& operator[](unsigned long Index); 00080 00081 // METHOD=mm:92acb970-4021-11e0-9e6a-d134ac8dd9fe 00082 unsigned long& operator()(unsigned long Index); 00083 00084 // METHOD=mm:9b04f05f-4021-11e0-9e6a-d134ac8dd9fe 00085 operator unsigned long* const(); 00086 00087 // METHOD=mm:249e9cb9-3ec4-11e0-8408-f25596bc45f2 00088 Type * const GetData(); 00089 00090 // METHOD=mm:ab790d88-e57e-4eca-ba78-1757c4e00dcb 00091 unsigned long long SizeOf(); 00092 00093 // METHOD=mm:ff50975d-5f81-11e0-89bf-82ea5c842841 00094 unsigned long GetRowSize(unsigned long Row); 00095 00096 // METHOD=mm:73675779-3f93-11e0-8a76-8537be356171 00097 Type* GetRowData(unsigned long Row, unsigned long& RowSize); 00098 00099 // METHOD=mm:1b315505-3f95-11e0-8a76-8537be356171 00100 unsigned long* GetIndices(); 00101 00102 // METHOD=mm:249e9cba-3ec4-11e0-8408-f25596bc45f2 00103 unsigned long GetTableSize(); 00104 00105 // METHOD=mm:7d8a4525-3f95-11e0-8a76-8537be356171 00106 unsigned long GetIndexSize(); 00107 00108 // METHOD=mm:e9afdd8b-accd-11e0-89c0-a61a639799d8 00109 void SetIndexSize(unsigned long RowNumber = 0, unsigned long* Indices = 0); 00110 00111 // METHOD=mm:55a6eb37-4046-11e0-9e6a-d134ac8dd9fe 00112 void SetSize(unsigned long RowNumber = 0, unsigned long DataNumber = 0, Type* Data = 0, unsigned long* Indices = 0); 00113 00114 // METHOD=mm:1ba251d1-a269-11e0-8de4-beed0730ada8 00115 void ResizeRow(unsigned long RowNumber, unsigned long NewSizeRow, Type* DataRow = 0); 00116 00117 // METHOD=mm:00f178b1-4022-11e0-9e6a-d134ac8dd9fe 00118 void NewRow(Type* RowData, unsigned long RowSize); 00119 00120 // METHOD=mm:b4b81e6f-4045-11e0-9e6a-d134ac8dd9fe 00121 void SetRow(Type* RowData, unsigned long RowIndex); 00122 00123 // METHOD=mm:249e9cc1-3ec4-11e0-8408-f25596bc45f2 00124 void Print(FILE* File, char* Format, char* Message = ""); 00125 00126 // METHOD=mm:249e9cc2-3ec4-11e0-8408-f25596bc45f2 00127 void Save(FILE* File); 00128 00129 // METHOD=mm:249e9cc3-3ec4-11e0-8408-f25596bc45f2 00130 void Save(char* TabName, int Version, char* Filename); 00131 00132 // METHOD=mm:249e9cc4-3ec4-11e0-8408-f25596bc45f2 00133 void Restore(FILE* File); 00134 00135 // METHOD=mm:249e9cc5-3ec4-11e0-8408-f25596bc45f2 00136 void Restore(char* TabName, int Version, char* Filename); 00137 00138 // METHOD=mm:249e9cca-3ec4-11e0-8408-f25596bc45f2 00139 void Free(); 00140 00141 00142 protected: 00143 00144 private: 00145 00146 // METHOD=mm:249e9ccb-3ec4-11e0-8408-f25596bc45f2 00147 void Alloc(unsigned long RowNumber, unsigned long DataNumber, Type* Data, unsigned long* Indices); 00148 00149 00150 // attr=mm:8eb850e1-3ec6-11e0-8408-f25596bc45f2 00151 BuiltInArray<unsigned long> IndicesArray; 00152 // attr=mm:89f3a60f-3ec6-11e0-8408-f25596bc45f2 00153 BuiltInArray<Type> DataArray; 00154 00155 00156 //#UBLK-BEG-CLASSMEMB mm:2799887c-3ec4-11e0-8408-f25596bc45f2 00157 //#UBLK-END-CLASSMEMB 00158 }; 00159 00160 00161 // template implementation 00162 #include "OneIndexTable.cpp" 00163 00164 00165 //#UBLK-BEG-GLOBALH 00166 //#UBLK-END-GLOBALH 00167 00168 00169 #endif // _ONEINDEXTABLE_H_