]> SALOME platform Git repositories - modules/med.git/blob - src/MEDMEM/MEDMEM_SkyLineArray.cxx
Salome HOME
Final version V2_0_1 which works with Med File V2.1 and the KERNEL
[modules/med.git] / src / MEDMEM / MEDMEM_SkyLineArray.cxx
1 using namespace std;
2 #include "MEDMEM_SkyLineArray.hxx"
3 #include "utilities.h"
4 using namespace MEDMEM;
5
6 MEDSKYLINEARRAY::MEDSKYLINEARRAY(): _count(0), _length(0),
7                                 _index((med_int*)NULL),_value((med_int*)NULL)
8 {
9   MESSAGE("Constructeur MEDSKYLINEARRAY sans parametre");
10 }
11
12 MEDSKYLINEARRAY::MEDSKYLINEARRAY(const MEDSKYLINEARRAY &myArray):
13                                 _count(myArray._count),_length(myArray._length),
14                                 _index(_count+1),_value(_length)
15 {
16         BEGIN_OF("MEDSKYLINEARRAY(const MEDSKYLINEARRAY &)");
17         memcpy(_index,myArray._index,sizeof(med_int)*(_count+1));
18         memcpy(_value,myArray._value,sizeof(med_int)*_length);
19         END_OF("MEDSKYLINEARRAY(const MEDSKYLINEARRAY &)");
20 }
21
22 MEDSKYLINEARRAY::~MEDSKYLINEARRAY()
23 {
24   MESSAGE("Destructeur ~MEDSKYLINEARRAY");
25
26   //if (_index != NULL) delete [] _index;
27   //if (_value != NULL) delete [] _value;
28 }
29
30 MEDSKYLINEARRAY::MEDSKYLINEARRAY(const med_int count, const med_int length):
31                                 _count(count), _length(length),
32                                 _index(_count+1),_value(_length)
33 {
34         MESSAGE("Constructeur MEDSKYLINEARRAY(count="<<count<<", length="<<length<<") avec parametres");
35 }
36
37 MEDSKYLINEARRAY::MEDSKYLINEARRAY(const med_int count, const med_int length,
38                                  const med_int* index, const med_int* value,bool shallowCopy):
39                                 _count(count), _length(length)
40 {
41         MESSAGE("Constructeur MEDSKYLINEARRAY(count="<<count<<", length="<<length<<") avec parametres");
42                 if(shallowCopy)
43           {
44             _index.setShallowAndOwnership(index);
45             _value.setShallowAndOwnership(value);
46           }
47         else
48           {
49             _index.set(_count+1,index);
50             _value.set(_length,value);
51           }
52 }
53
54 //  void MEDSKYLINEARRAY::setMEDSKYLINEARRAY( const med_int count , const med_int length, med_int* index , med_int* value )
55 //  {
56 //    MESSAGE("void MEDSKYLINEARRAY::setMEDSKYLINEARRAY(count, length, index, value)");
57 //    _count  = count  ;
58 //    _length = length ;
59
60 //    //if (_index != NULL) delete [] _index;
61 //    //if (_value != NULL) delete [] _value;
62
63 //        _index.set(index);
64 //        _value.set(value);
65 //  }