hp2FEM  0.1
include/ds/PointerArray.h
00001 #ifndef _POINTERARRAY_H_
00002 #define _POINTERARRAY_H_
00003 // ---------------------------------------------
00004 // company   : 
00005 // user      : 
00006 // date      : 22 Mar 2015 17:21
00007 // file      : PointerArray.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 template <class Type>
00047 class PointerArray
00048 {
00049 //#UBLK-BEG-CLASSDEF mm:01ec3f0f-2f95-11e0-93c6-d1013a36be4a
00050 //#UBLK-END-CLASSDEF
00051 
00052  public:
00053 
00054    // METHOD=mm:01ec3fd0-2f95-11e0-93c6-d1013a36be4a
00055    PointerArray();
00056 
00057    // METHOD=mm:01ec3fd1-2f95-11e0-93c6-d1013a36be4a
00058    PointerArray(long ArraySize, Type** Pointers = 0);
00059 
00060    // METHOD=mm:01ec400a-2f95-11e0-93c6-d1013a36be4a
00061    PointerArray(PointerArray<Type>& Instance);
00062 
00063    // METHOD=mm:01ec400c-2f95-11e0-93c6-d1013a36be4a
00064    ~PointerArray();
00065 
00066    // METHOD=mm:01ec400d-2f95-11e0-93c6-d1013a36be4a
00067    PointerArray<Type>& operator=(PointerArray<Type>& Instance);
00068 
00069    // METHOD=mm:01ec4013-2f95-11e0-93c6-d1013a36be4a
00070    Type& operator[](long Index);
00071 
00072    // METHOD=mm:01ec4015-2f95-11e0-93c6-d1013a36be4a
00073    Type*& operator()(long Index);
00074 
00075    // METHOD=mm:01ec4017-2f95-11e0-93c6-d1013a36be4a
00076    operator Type*const*();
00077 
00078    // METHOD=mm:01ec401c-2f95-11e0-93c6-d1013a36be4a
00079    void SetSize(long ArraySize = 0);
00080 
00081    // METHOD=mm:01ec401e-2f95-11e0-93c6-d1013a36be4a
00082    long GetSize();
00083 
00084    // METHOD=mm:01ec401f-2f95-11e0-93c6-d1013a36be4a
00085    void Resize(long NewSize);
00086 
00087    // METHOD=mm:01ec4021-2f95-11e0-93c6-d1013a36be4a
00088    void Print(FILE* File = stdout, char* Message = "");
00089 
00090    // METHOD=mm:01ec4028-2f95-11e0-93c6-d1013a36be4a
00091    void Save(FILE* File);
00092 
00093    // METHOD=mm:01ec402a-2f95-11e0-93c6-d1013a36be4a
00094    void Save(char* TabName, int Version, char* Filename);
00095 
00096    // METHOD=mm:01ec4032-2f95-11e0-93c6-d1013a36be4a
00097    void Restore(FILE* File);
00098 
00099    // METHOD=mm:01ec4034-2f95-11e0-93c6-d1013a36be4a
00100    void Restore(char* TabName, int Version, char* Filename);
00101 
00102    // METHOD=mm:01ec403c-2f95-11e0-93c6-d1013a36be4a
00103    void Free();
00104 
00105    // METHOD=mm:01ec403d-2f95-11e0-93c6-d1013a36be4a
00106    void FreeArray();
00107 
00108 
00109  protected:
00110 
00111  private:
00112 
00113    // METHOD=mm:01ec3fcd-2f95-11e0-93c6-d1013a36be4a
00114    void Alloc(long ArraySize = 0, Type** PArray = 0);
00115 
00116 
00120    // attr=mm:01ec3fc7-2f95-11e0-93c6-d1013a36be4a
00121    long Size;
00122 
00126    // attr=mm:01ec3fcc-2f95-11e0-93c6-d1013a36be4a
00127    Type** Ar;
00128 
00129 
00130 //#UBLK-BEG-CLASSMEMB mm:01ec3f0f-2f95-11e0-93c6-d1013a36be4a
00131 //#UBLK-END-CLASSMEMB
00132 };
00133 
00134 
00135 // template implementation
00136 #include "PointerArray.cpp"
00137 
00138 
00139 //#UBLK-BEG-GLOBALH
00140 //#UBLK-END-GLOBALH
00141 
00142 
00143 #endif // _POINTERARRAY_H_
 All Classes Files Functions Variables Typedefs Friends Defines