hp2FEM  0.1
include/ds/Array.h
00001 #ifndef _ARRAY_H_
00002 #define _ARRAY_H_
00003 // ---------------------------------------------
00004 // company   : 
00005 // user      : 
00006 // date      : 22 Mar 2015 17:21
00007 // file      : Array.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 Array
00051 {
00052 //#UBLK-BEG-CLASSDEF mm:00266a0f-2f9d-11e0-93c6-d1013a36be4a
00053 //#UBLK-END-CLASSDEF
00054 
00055  public:
00056 
00057    // METHOD=mm:00266a55-2f9d-11e0-93c6-d1013a36be4a
00058    Array();
00059 
00060    // METHOD=mm:00266a56-2f9d-11e0-93c6-d1013a36be4a
00061    Array(long ArraySize, Type* Elements = 0);
00062 
00063    // METHOD=mm:00266a57-2f9d-11e0-93c6-d1013a36be4a
00064    Array(Array<Type>& Instance);
00065 
00066    // METHOD=mm:00266a5c-2f9d-11e0-93c6-d1013a36be4a
00067    ~Array();
00068 
00069    // METHOD=mm:00266a5d-2f9d-11e0-93c6-d1013a36be4a
00070    Array<Type>& operator=(Array<Type>& Instance);
00071 
00072    // METHOD=mm:00266a5e-2f9d-11e0-93c6-d1013a36be4a
00073    Type& operator[](long Index);
00074 
00075    // METHOD=mm:00266a5f-2f9d-11e0-93c6-d1013a36be4a
00076    operator Type * const();
00077 
00078    // METHOD=mm:00266a60-2f9d-11e0-93c6-d1013a36be4a
00079    long GetSize();
00080 
00081    // METHOD=mm:00266a61-2f9d-11e0-93c6-d1013a36be4a
00082    void SetSize(long ArraySize = 0);
00083 
00084    // METHOD=mm:66dbc97a-30b7-4f9f-9282-fddc55e2797d
00085    void SetSize(long ArraySize, Type* Elements);
00086 
00087    // METHOD=mm:00266a66-2f9d-11e0-93c6-d1013a36be4a
00088    void Resize(long NewSize);
00089 
00090    // METHOD=mm:00266a67-2f9d-11e0-93c6-d1013a36be4a
00091    void Print(FILE* File, char* Message = "");
00092 
00093    // METHOD=mm:00266a68-2f9d-11e0-93c6-d1013a36be4a
00094    void Save(FILE* File);
00095 
00096    // METHOD=mm:00266a69-2f9d-11e0-93c6-d1013a36be4a
00097    void Save(char* TabName, int Version, char* Filename);
00098 
00099    // METHOD=mm:00266a6a-2f9d-11e0-93c6-d1013a36be4a
00100    void Restore(FILE* File);
00101 
00102    // METHOD=mm:00266a6b-2f9d-11e0-93c6-d1013a36be4a
00103    void Restore(char* TabName, int Version, char* Filename);
00104 
00105    // METHOD=mm:00266a70-2f9d-11e0-93c6-d1013a36be4a
00106    void Free();
00107 
00108 
00109  protected:
00110 
00111  private:
00112 
00113    // METHOD=mm:00266a71-2f9d-11e0-93c6-d1013a36be4a
00114    void Alloc(long ArraySize = 0, Type* PArray = 0);
00115 
00116 
00120    // attr=mm:00266a53-2f9d-11e0-93c6-d1013a36be4a
00121    long Size;
00122 
00126    // attr=mm:00266a54-2f9d-11e0-93c6-d1013a36be4a
00127    Type* Ar;
00128 
00129 
00130 //#UBLK-BEG-CLASSMEMB mm:00266a0f-2f9d-11e0-93c6-d1013a36be4a
00131 //#UBLK-END-CLASSMEMB
00132 };
00133 
00134 
00135 // template implementation
00136 #include "Array.cpp"
00137 
00138 
00139 //#UBLK-BEG-GLOBALH
00140 //*** Removed methods: 12 May 2014 15:07
00141 //---
00142 //uuid=mm:22dd79c2-2596-40a3-b551-29cb446b5cb5
00143 //   void SetSize(Type* Elements, long ArraySize = 0);
00144 
00145 //*** Removed methods: 01 Jul 2014 13:18
00146 //---
00147 //uuid=mm:f7a03756-aa62-41f2-bc8d-4179ed7e8563
00148 //   operator Type&();
00149 
00150 //#UBLK-END-GLOBALH
00151 
00152 
00153 #endif // _ARRAY_H_
 All Classes Files Functions Variables Typedefs Friends Defines