-void MEDCouplingTimeDiscretization::getTinySerializationIntInformation(std::vector<int>& tinyInfo) const
-{
- if(_array)
- {
- tinyInfo.push_back(_array->getNumberOfTuples());
- tinyInfo.push_back(_array->getNumberOfComponents());
- }
- else
- {
- tinyInfo.push_back(-1);
- tinyInfo.push_back(-1);
- }
-}
-
-void MEDCouplingTimeDiscretization::resizeForUnserialization(const std::vector<int>& tinyInfoI, std::vector<DataArrayDouble *>& arrays)
-{
- arrays.resize(1);
- if(_array!=0)
- _array->decrRef();
- DataArrayDouble *arr=0;
- if(tinyInfoI[0]!=-1 && tinyInfoI[1]!=-1)
- {
- arr=DataArrayDouble::New();
- arr->alloc(tinyInfoI[0],tinyInfoI[1]);
- }
- _array=arr;
- arrays[0]=arr;
-}
-
-void MEDCouplingTimeDiscretization::checkForUnserialization(const std::vector<int>& tinyInfoI, const std::vector<DataArrayDouble *>& arrays)
-{
- static const char MSG[]="MEDCouplingTimeDiscretization::checkForUnserialization : arrays in input is expected to have size one !";
- if(arrays.size()!=1)
- throw INTERP_KERNEL::Exception(MSG);
- if(_array!=0)
- _array->decrRef();
- _array=0;
- if(tinyInfoI[0]!=-1 && tinyInfoI[1]!=-1)
- {
- if(!arrays[0])
- throw INTERP_KERNEL::Exception(MSG);
- arrays[0]->checkNbOfTuplesAndComp(tinyInfoI[0],tinyInfoI[1],MSG);
- _array=arrays[0];
- _array->incrRef();
- }
-}
-
-void MEDCouplingTimeDiscretization::finishUnserialization(const std::vector<int>& tinyInfoI, const std::vector<double>& tinyInfoD, const std::vector<std::string>& tinyInfoS)
-{
- _time_tolerance=tinyInfoD[0];
- int nbOfCompo=_array->getNumberOfComponents();
- for(int i=0;i<nbOfCompo;i++)
- _array->setInfoOnComponent(i,tinyInfoS[i]);
-}
-
-void MEDCouplingTimeDiscretization::getTinySerializationDbleInformation(std::vector<double>& tinyInfo) const
-{
- tinyInfo.push_back(_time_tolerance);
-}
-
-void MEDCouplingTimeDiscretization::getTinySerializationStrInformation(std::vector<std::string>& tinyInfo) const
-{
- int nbOfCompo=_array->getNumberOfComponents();
- for(int i=0;i<nbOfCompo;i++)
- tinyInfo.push_back(_array->getInfoOnComponent(i));
-}
-
-const DataArrayDouble *MEDCouplingTimeDiscretization::getEndArray() const
-{
- throw INTERP_KERNEL::Exception("getEndArray not available for this type of time discretization !");
-}
-
-DataArrayDouble *MEDCouplingTimeDiscretization::getEndArray()
-{
- throw INTERP_KERNEL::Exception("getEndArray not available for this type of time discretization !");
-}
-
-void MEDCouplingTimeDiscretization::setEndArray(DataArrayDouble *array, TimeLabel *owner)
-{
- throw INTERP_KERNEL::Exception("setEndArray not available for this type of time discretization !");
-}
-
-void MEDCouplingTimeDiscretization::setArrays(const std::vector<DataArrayDouble *>& arrays, TimeLabel *owner)
-{
- if(arrays.size()!=1)
- throw INTERP_KERNEL::Exception("MEDCouplingTimeDiscretization::setArrays : number of arrays must be one.");
- setArray(arrays.back(),owner);
-}
-
-void MEDCouplingTimeDiscretization::getArrays(std::vector<DataArrayDouble *>& arrays) const
-{
- arrays.resize(1);
- arrays[0]=_array;
-}
-