From: Anthony Geay Date: Thu, 20 Dec 2018 09:34:21 +0000 (+0100) Subject: Clean up X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Fagy%2Ftest_i8;p=tools%2Fmedcoupling.git Clean up --- diff --git a/src/MEDCoupling/MEDCouplingMemArray.txx b/src/MEDCoupling/MEDCouplingMemArray.txx index a08ada46a..b35f1c0e4 100644 --- a/src/MEDCoupling/MEDCouplingMemArray.txx +++ b/src/MEDCoupling/MEDCouplingMemArray.txx @@ -601,7 +601,7 @@ namespace MEDCoupling { std::size_t sz(_mem.getNbOfElemAllocated()); sz*=sizeof(T); - return DataArray::getHeapMemorySizeWithoutChildren()+sz; + return this->getHeapMemorySizeWithoutChildren()+sz; } /*! @@ -1128,7 +1128,7 @@ namespace MEDCoupling template typename Traits::ArrayType *DataArrayTemplate::mySelectByTupleId(const DataArrayInt& di) const { - return DataArrayTemplate::mySelectByTupleId(di.begin(),di.end()); + return this->mySelectByTupleId(di.begin(),di.end()); } template @@ -3351,7 +3351,7 @@ struct NotInRange template void DataArrayTemplateClassic::reprWithoutNameStream(std::ostream& stream) const { - DataArray::reprWithoutNameStream(stream); + this->reprWithoutNameStream(stream); ImplReprTraits::SetPrecision(stream); this->_mem.repr(this->getNumberOfComponents(),stream); } @@ -3359,7 +3359,7 @@ struct NotInRange template void DataArrayTemplateClassic::reprZipWithoutNameStream(std::ostream& stream) const { - DataArray::reprWithoutNameStream(stream); + this->reprWithoutNameStream(stream); ImplReprTraits::SetPrecision(stream); this->_mem.reprZip(this->getNumberOfComponents(),stream); } @@ -3367,7 +3367,7 @@ struct NotInRange template void DataArrayTemplateClassic::reprNotTooLongWithoutNameStream(std::ostream& stream) const { - DataArray::reprWithoutNameStream(stream); + this->reprWithoutNameStream(stream); ImplReprTraits::SetPrecision(stream); this->_mem.reprNotTooLong(this->getNumberOfComponents(),stream); } @@ -3740,14 +3740,14 @@ struct NotInRange template int DataArrayDiscrete::getHashCode() const { - DataArrayTemplate::checkAllocated(); - std::size_t nbOfElems(DataArrayTemplate::getNbOfElems()); + this->checkAllocated(); + std::size_t nbOfElems(this->getNbOfElems()); int ret=nbOfElems*65536; int delta=3; if(nbOfElems>48) delta=nbOfElems/8; T ret0(0); - const T *pt(DataArrayTemplate::begin()); + const T *pt(this->begin()); for(std::size_t i=0;i void DataArrayDiscrete::reprCppStream(const std::string& varName, std::ostream& stream) const { - std::size_t nbTuples(DataArrayTemplate::getNumberOfTuples()),nbComp(DataArray::getNumberOfComponents()); - const T *data(DataArrayTemplate::getConstPointer()); + std::size_t nbTuples(this->getNumberOfTuples()),nbComp(this->getNumberOfComponents()); + const T *data(this->getConstPointer()); stream << Traits::ArrayTypeName << " *" << varName << "=" << Traits::ArrayTypeName << "::New();" << std::endl; if(nbTuples*nbComp>=1) { @@ -3791,7 +3791,7 @@ struct NotInRange } else stream << varName << "->alloc(" << nbTuples << "," << nbComp << ");" << std::endl; - stream << varName << "->setName(\"" << DataArray::getName() << "\");" << std::endl; + stream << varName << "->setName(\"" << this->getName() << "\");" << std::endl; } /*! @@ -3802,12 +3802,12 @@ struct NotInRange { static const std::size_t MAX_NB_OF_BYTE_IN_REPR=300; stream << Traits::ArrayTypeName << " C++ instance at " << this << ". "; - if(DataArrayTemplate::isAllocated()) + if(this->isAllocated()) { - std::size_t nbOfCompo(DataArray::getNumberOfComponents()); + std::size_t nbOfCompo(this->getNumberOfComponents()); if(nbOfCompo>=1) { - std::size_t nbOfTuples(DataArrayTemplate::getNumberOfTuples()); + std::size_t nbOfTuples(this->getNumberOfTuples()); stream << "Number of tuples : " << nbOfTuples << ". Number of components : " << nbOfCompo << "." << std::endl; reprQuickOverviewData(stream,MAX_NB_OF_BYTE_IN_REPR); } @@ -3821,8 +3821,8 @@ struct NotInRange template void DataArrayDiscrete::reprQuickOverviewData(std::ostream& stream, std::size_t maxNbOfByteInRepr) const { - const T *data(DataArrayTemplate::begin()); - std::size_t nbOfTuples(DataArrayTemplate::getNumberOfTuples()),nbOfCompo(DataArray::getNumberOfComponents()); + const T *data(this->begin()); + std::size_t nbOfTuples(this->getNumberOfTuples()),nbOfCompo(this->getNumberOfComponents()); std::ostringstream oss2; oss2 << "["; std::string oss2Str(oss2.str()); bool isFinished=true; @@ -3857,31 +3857,31 @@ struct NotInRange void DataArrayDiscrete::writeVTK(std::ostream& ofs, int indent, const std::string& type, const std::string& nameInFile, DataArrayByte *byteArr) const { static const char SPACE[4]={' ',' ',' ',' '}; - DataArrayTemplate::checkAllocated(); + this->checkAllocated(); std::string idt(indent,' '); - ofs << idt << "::getNumberOfComponents() << "\""; + ofs << idt << "getNumberOfComponents() << "\""; if(byteArr) { ofs << " format=\"appended\" offset=\"" << byteArr->getNumberOfTuples() << "\">"; if(std::string(type)==Traits::VTKReprStr) { - const char *data(reinterpret_cast(DataArrayTemplate::begin())); - std::size_t sz(DataArrayTemplate::getNbOfElems()*sizeof(T)); + const char *data(reinterpret_cast(this->begin())); + std::size_t sz(this->getNbOfElems()*sizeof(T)); byteArr->insertAtTheEnd(data,data+sz); byteArr->insertAtTheEnd(SPACE,SPACE+4); } else if(std::string(type)=="Int8") { - INTERP_KERNEL::AutoPtr tmp(new char[DataArrayTemplate::getNbOfElems()]); - std::copy(DataArrayTemplate::begin(),DataArrayTemplate::end(),(char *)tmp); - byteArr->insertAtTheEnd((char *)tmp,(char *)tmp+DataArrayTemplate::getNbOfElems()); + INTERP_KERNEL::AutoPtr tmp(new char[this->getNbOfElems()]); + std::copy(this->begin(),this->end(),(char *)tmp); + byteArr->insertAtTheEnd((char *)tmp,(char *)tmp+this->getNbOfElems()); byteArr->insertAtTheEnd(SPACE,SPACE+4); } else if(std::string(type)=="UInt8") { - INTERP_KERNEL::AutoPtr tmp(new unsigned char[DataArrayTemplate::getNbOfElems()]); - std::copy(DataArrayTemplate::begin(),DataArrayTemplate::end(),(unsigned char *)tmp); - byteArr->insertAtTheEnd((unsigned char *)tmp,(unsigned char *)tmp+DataArrayTemplate::getNbOfElems()); + INTERP_KERNEL::AutoPtr tmp(new unsigned char[this->getNbOfElems()]); + std::copy(this->begin(),this->end(),(unsigned char *)tmp); + byteArr->insertAtTheEnd((unsigned char *)tmp,(unsigned char *)tmp+this->getNbOfElems()); byteArr->insertAtTheEnd(SPACE,SPACE+4); } else @@ -3893,8 +3893,8 @@ struct NotInRange } else { - ofs << " RangeMin=\"" << DataArrayTemplate::getMinValueInArray() << "\" RangeMax=\"" << DataArrayTemplate::getMaxValueInArray() << "\" format=\"ascii\">\n" << idt; - std::copy(DataArrayTemplate::begin(),DataArrayTemplate::end(),std::ostream_iterator(ofs," ")); + ofs << " RangeMin=\"" << this->getMinValueInArray() << "\" RangeMax=\"" << this->getMaxValueInArray() << "\" format=\"ascii\">\n" << idt; + std::copy(this->begin(),this->end(),std::ostream_iterator(ofs," ")); } ofs << std::endl << idt << "\n"; }