Back to index

salome-med  6.5.0
DataArrayDoubleServant.cxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D
00002 //
00003 // This library is free software; you can redistribute it and/or
00004 // modify it under the terms of the GNU Lesser General Public
00005 // License as published by the Free Software Foundation; either
00006 // version 2.1 of the License.
00007 //
00008 // This library is distributed in the hope that it will be useful,
00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011 // Lesser General Public License for more details.
00012 //
00013 // You should have received a copy of the GNU Lesser General Public
00014 // License along with this library; if not, write to the Free Software
00015 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00016 //
00017 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00018 //
00019 
00020 #include "DataArrayDoubleServant.hxx"
00021 #include "MEDCouplingMemArray.hxx"
00022 
00023 using namespace ParaMEDMEM;
00024 
00025 DataArrayDoubleServant::DataArrayDoubleServant(const DataArrayDouble *cppPointer):MEDCouplingRefCountServant(cppPointer,cppPointer)
00026 {
00027 }
00028 
00029 void DataArrayDoubleServant::getTinyInfo(SALOME_TYPES::ListOfLong_out la, SALOME_TYPES::ListOfString_out sa)
00030 {
00031   la=new SALOME_TYPES::ListOfLong;
00032   std::vector<int> tinyInfo;
00033   getPointer()->getTinySerializationIntInformation(tinyInfo);
00034   la->length(tinyInfo.size());
00035   for(int i=0;i<(int)tinyInfo.size();i++)
00036     (*la)[i]=tinyInfo[i];
00037   //
00038   sa=new SALOME_TYPES::ListOfString;
00039   std::vector<std::string> tinyInfo3;
00040   getPointer()->getTinySerializationStrInformation(tinyInfo3);
00041   sa->length(tinyInfo3.size());
00042   for(int i=0;i<(int)tinyInfo3.size();i++)
00043     (*sa)[i]=CORBA::string_dup(tinyInfo3[i].c_str());
00044 }
00045 
00046 void DataArrayDoubleServant::getSerialisationData(SALOME_TYPES::ListOfDouble_out da)
00047 {
00048   da=new SALOME_TYPES::ListOfDouble;
00049   if(getPointer()->isAllocated())
00050     {
00051       int nbElem=getPointer()->getNbOfElems();
00052       const double *data=getPointer()->getConstPointer();
00053       da->length(nbElem);
00054       for(int i=0;i<nbElem;i++)
00055         (*da)[i]=data[i];
00056     }
00057   else
00058     {
00059       da->length(0);
00060     }
00061 }
00062 
00063 SALOME::StringSeq *DataArrayDoubleServant::GetExportableFormats()
00064 {
00065   SALOME::StringSeq *ret=new SALOME::StringSeq;
00066   ret->length(0);
00067   return ret;
00068 }
00069 
00070 CORBA::Boolean DataArrayDoubleServant::ExportDataAs(const char *format, SALOME::GenericObj_out exporter)
00071 {
00072   exporter=SALOME::GenericObj::_nil();
00073   return false;
00074 }