1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 #include "MemArray.txx"
21 using namespace ParaMEDMEM;
23 void DataArray::setName(const char *name)
28 DataArrayDouble *DataArrayDouble::New()
30 return new DataArrayDouble;
33 void DataArrayDouble::alloc(int nbOfTuple, int nbOfCompo)
35 _nb_of_tuples=nbOfTuple;
36 _info_on_compo.resize(nbOfCompo);
37 _mem.alloc(nbOfCompo*_nb_of_tuples);
41 void DataArrayDouble::reAlloc(int nbOfTuples)
43 _mem.reAlloc(_info_on_compo.size()*nbOfTuples);
44 _nb_of_tuples=nbOfTuples;
48 void DataArrayDouble::useArray(double *array, bool ownership, DeallocType type, int nbOfTuple, int nbOfCompo)
50 _nb_of_tuples=nbOfTuple;
51 _info_on_compo.resize(nbOfCompo);
52 _mem.useArray(array,ownership,type,nbOfTuple*nbOfCompo);
56 DataArrayInt *DataArrayInt::New()
58 return new DataArrayInt;
61 void DataArrayInt::alloc(int nbOfTuple, int nbOfCompo)
63 _nb_of_tuples=nbOfTuple;
64 _info_on_compo.resize(nbOfCompo);
65 _mem.alloc(nbOfCompo*_nb_of_tuples);
69 void DataArrayInt::useArray(int *array, bool ownership, DeallocType type, int nbOfTuple, int nbOfCompo)
71 _nb_of_tuples=nbOfTuple;
72 _info_on_compo.resize(nbOfCompo);
73 _mem.useArray(array,ownership,type,nbOfTuple*nbOfCompo);
77 void DataArrayInt::reAlloc(int nbOfTuples)
79 _mem.reAlloc(_info_on_compo.size()*nbOfTuples);
80 _nb_of_tuples=nbOfTuples;