Salome HOME
update from the MedMemory V1.0.1
[modules/med.git] / src / MEDMEM / MEDMEM_SkyLineArray.cxx
1 using namespace std;
2 #include "MEDMEM_SkyLineArray.hxx"
3 #include "utilities.h"
4
5 MEDSKYLINEARRAY::MEDSKYLINEARRAY(): _count(0), _length(0),
6                                 _index((med_int*)NULL),_value((med_int*)NULL)
7 {
8   MESSAGE("Constructeur MEDSKYLINEARRAY sans parametre");
9 }
10
11 MEDSKYLINEARRAY::MEDSKYLINEARRAY(const MEDSKYLINEARRAY &myArray):
12                                 _count(myArray._count),_length(myArray._length),
13                                 _index(_count+1),_value(_length)
14 {
15         BEGIN_OF("MEDSKYLINEARRAY(const MEDSKYLINEARRAY &)");
16         memcpy(_index,myArray._index,sizeof(med_int)*(_count+1));
17         memcpy(_value,myArray._value,sizeof(med_int)*_length);
18         END_OF("MEDSKYLINEARRAY(const MEDSKYLINEARRAY &)");
19 }
20
21 MEDSKYLINEARRAY::~MEDSKYLINEARRAY()
22 {
23   MESSAGE("Destructeur ~MEDSKYLINEARRAY");
24
25   //if (_index != NULL) delete [] _index;
26   //if (_value != NULL) delete [] _value;
27 }
28
29 MEDSKYLINEARRAY::MEDSKYLINEARRAY(const med_int count, const med_int length):
30                                 _count(count), _length(length),
31                                 _index(_count+1),_value(_length)
32 {
33         MESSAGE("Constructeur MEDSKYLINEARRAY(count="<<count<<", length="<<length<<") avec parametres");
34 }
35
36 MEDSKYLINEARRAY::MEDSKYLINEARRAY(const med_int count, const med_int length,
37                                  const med_int* index, const med_int* value):
38                                 _count(count), _length(length),
39                                 _index(_count+1),_value(_length)
40 {
41         MESSAGE("Constructeur MEDSKYLINEARRAY(count="<<count<<", length="<<length<<") avec parametres");
42         memcpy((med_int*)_index,index,sizeof(med_int)*(_count+1));
43         memcpy((med_int*)_value,value,sizeof(med_int)*_length);
44 }
45
46 //  void MEDSKYLINEARRAY::setMEDSKYLINEARRAY( const med_int count , const med_int length, med_int* index , med_int* value )
47 //  {
48 //    MESSAGE("void MEDSKYLINEARRAY::setMEDSKYLINEARRAY(count, length, index, value)");
49 //    _count  = count  ;
50 //    _length = length ;
51
52 //    //if (_index != NULL) delete [] _index;
53 //    //if (_value != NULL) delete [] _value;
54
55 //        _index.set(index);
56 //        _value.set(value);
57 //  }