hp2FEM
0.1
|
00001 #ifndef _BUILTINARRAY_H_ 00002 #define _BUILTINARRAY_H_ 00003 // --------------------------------------------- 00004 // company : 00005 // user : 00006 // date : 22 Mar 2015 17:21 00007 // file : BuiltInArray.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 : 03 Fev 2011 00019 //-------------------------------------------------------------- 00020 // Change history : 00021 // 03 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 <cstdio> 00047 00048 00049 template <class Type> 00050 class BuiltInArray 00051 { 00052 //#UBLK-BEG-CLASSDEF mm:01ec3ef1-2f95-11e0-93c6-d1013a36be4a 00053 //#UBLK-END-CLASSDEF 00054 00055 public: 00056 00057 // METHOD=mm:01ec3f31-2f95-11e0-93c6-d1013a36be4a 00058 BuiltInArray(); 00059 00060 // METHOD=mm:01ec3f36-2f95-11e0-93c6-d1013a36be4a 00061 BuiltInArray(long ArraySize, Type* Elements = 0); 00062 00063 // METHOD=mm:01ec3f39-2f95-11e0-93c6-d1013a36be4a 00064 BuiltInArray(BuiltInArray<Type>& Instance); 00065 00066 // METHOD=mm:01ec3f3b-2f95-11e0-93c6-d1013a36be4a 00067 ~BuiltInArray(); 00068 00069 // METHOD=mm:01ec3f40-2f95-11e0-93c6-d1013a36be4a 00070 BuiltInArray<Type>& operator=(BuiltInArray<Type>& Instance); 00071 00072 // METHOD=mm:01ec3f42-2f95-11e0-93c6-d1013a36be4a 00073 Type& operator[](long Index); 00074 00075 // METHOD=mm:01ec3f44-2f95-11e0-93c6-d1013a36be4a 00076 operator Type*const(); 00077 00078 // METHOD=mm:b305360a-9a08-465d-a519-b644faa885d8 00079 unsigned long long SizeOf(); 00080 00081 // METHOD=mm:01ec3f45-2f95-11e0-93c6-d1013a36be4a 00082 unsigned long GetSize(); 00083 00084 // METHOD=mm:01ec3f4a-2f95-11e0-93c6-d1013a36be4a 00085 void SetSize(unsigned long ArraySize = 0, Type* Elements = 0); 00086 00087 // METHOD=mm:2bd3bd05-5fb9-11e0-89bf-82ea5c842841 00088 void SetSize(unsigned long ArraySize, Type Value); 00089 00090 // METHOD=mm:01ec3f4c-2f95-11e0-93c6-d1013a36be4a 00091 void Resize(long NewSize); 00092 00093 // METHOD=mm:01ec3f4e-2f95-11e0-93c6-d1013a36be4a 00094 void Reset(Type Value = 0.0); 00095 00096 // METHOD=mm:01ec3f54-2f95-11e0-93c6-d1013a36be4a 00097 Type Find(Type Value); 00098 00099 // METHOD=mm:01ec3f56-2f95-11e0-93c6-d1013a36be4a 00100 Type Minimum(); 00101 00102 // METHOD=mm:01ec3f57-2f95-11e0-93c6-d1013a36be4a 00103 Type Maximum(); 00104 00105 // METHOD=mm:01ec3f58-2f95-11e0-93c6-d1013a36be4a 00106 void Read(FILE* File, char* Format); 00107 00108 // METHOD=mm:01ec3f5f-2f95-11e0-93c6-d1013a36be4a 00109 void Print(FILE* File, char* Format, int LineLength = 6, char* Message = ""); 00110 00111 // METHOD=mm:01ec3f68-2f95-11e0-93c6-d1013a36be4a 00112 void Save(FILE* File); 00113 00114 // METHOD=mm:01ec3f6a-2f95-11e0-93c6-d1013a36be4a 00115 void Save(char* TabName, int Version, char* Filename); 00116 00117 // METHOD=mm:01ec3f72-2f95-11e0-93c6-d1013a36be4a 00118 void Restore(FILE* File); 00119 00120 // METHOD=mm:01ec3f74-2f95-11e0-93c6-d1013a36be4a 00121 void Restore(char* TabName, int Version, char* Filename); 00122 00123 // METHOD=mm:01ec3f7c-2f95-11e0-93c6-d1013a36be4a 00124 void Free(); 00125 00126 00127 protected: 00128 00129 private: 00130 00131 // METHOD=mm:01ec3f2e-2f95-11e0-93c6-d1013a36be4a 00132 void Alloc(unsigned long ArraySize = 0, Type* PArray = 0); 00133 00134 00138 // attr=mm:01ec3f2c-2f95-11e0-93c6-d1013a36be4a 00139 unsigned long Size; 00140 00144 // attr=mm:c940c862-00df-49f8-97b9-7ec4ceb11dc9 00145 Type* Ar; 00146 00147 00148 //#UBLK-BEG-CLASSMEMB mm:01ec3ef1-2f95-11e0-93c6-d1013a36be4a 00149 //#UBLK-END-CLASSMEMB 00150 }; 00151 00152 00153 // template implementation 00154 #include "BuiltInArray.cpp" 00155 00156 00157 //#UBLK-BEG-GLOBALH 00158 //*** Removed methods: 12 May 2014 14:37 00159 //--- 00160 //uuid=mm:249e9cb8-3ec4-11e0-8408-f25596bc45f2 00162 00163 //#UBLK-END-GLOBALH 00164 00165 00166 #endif // _BUILTINARRAY_H_