1 #include "MEDMEM_SkyLineArray.hxx"
5 using namespace MEDMEM;
7 MEDSKYLINEARRAY::MEDSKYLINEARRAY(): _count(0), _length(0),
8 _index((int*)NULL),_value((int*)NULL)
10 MESSAGE("Constructeur MEDSKYLINEARRAY sans parametre");
13 MEDSKYLINEARRAY::MEDSKYLINEARRAY(const MEDSKYLINEARRAY &myArray):
14 _count(myArray._count),_length(myArray._length),
15 _index(_count+1),_value(_length)
17 BEGIN_OF("MEDSKYLINEARRAY(const MEDSKYLINEARRAY &)");
18 memcpy(_index,myArray._index,sizeof(int)*(_count+1));
19 memcpy(_value,myArray._value,sizeof(int)*_length);
20 END_OF("MEDSKYLINEARRAY(const MEDSKYLINEARRAY &)");
23 MEDSKYLINEARRAY::~MEDSKYLINEARRAY()
25 MESSAGE("Destructeur ~MEDSKYLINEARRAY");
27 //if (_index != NULL) delete [] _index;
28 //if (_value != NULL) delete [] _value;
31 MEDSKYLINEARRAY::MEDSKYLINEARRAY(const int count, const int length):
32 _count(count), _length(length),
33 _index(_count+1),_value(_length)
35 MESSAGE("Constructeur MEDSKYLINEARRAY(count="<<count<<", length="<<length<<") avec parametres");
38 MEDSKYLINEARRAY::MEDSKYLINEARRAY(const int count, const int length,
39 const int* index, const int* value,bool shallowCopy):
40 _count(count), _length(length)
42 // MESSAGE("Constructeur MEDSKYLINEARRAY(count="<<count<<", length="<<length<<") avec parametres");
45 _index.setShallowAndOwnership(index);
46 _value.setShallowAndOwnership(value);
50 _index.set(_count+1,index);
51 _value.set(_length,value);
55 // void MEDSKYLINEARRAY::setMEDSKYLINEARRAY( const int count , const int length, int* index , int* value )
57 // MESSAGE("void MEDSKYLINEARRAY::setMEDSKYLINEARRAY(count, length, index, value)");
61 // //if (_index != NULL) delete [] _index;
62 // //if (_value != NULL) delete [] _value;