{
std::size_t sz(_mem.getNbOfElemAllocated());
sz*=sizeof(T);
- return DataArray::getHeapMemorySizeWithoutChildren()+sz;
+ return this->getHeapMemorySizeWithoutChildren()+sz;
}
/*!
template<class T>
typename Traits<T>::ArrayType *DataArrayTemplate<T>::mySelectByTupleId(const DataArrayInt& di) const
{
- return DataArrayTemplate<T>::mySelectByTupleId(di.begin(),di.end());
+ return this->mySelectByTupleId(di.begin(),di.end());
}
template<class T>
template<class T>
void DataArrayTemplateClassic<T>::reprWithoutNameStream(std::ostream& stream) const
{
- DataArray::reprWithoutNameStream(stream);
+ this->reprWithoutNameStream(stream);
ImplReprTraits<T>::SetPrecision(stream);
this->_mem.repr(this->getNumberOfComponents(),stream);
}
template<class T>
void DataArrayTemplateClassic<T>::reprZipWithoutNameStream(std::ostream& stream) const
{
- DataArray::reprWithoutNameStream(stream);
+ this->reprWithoutNameStream(stream);
ImplReprTraits<T>::SetPrecision(stream);
this->_mem.reprZip(this->getNumberOfComponents(),stream);
}
template<class T>
void DataArrayTemplateClassic<T>::reprNotTooLongWithoutNameStream(std::ostream& stream) const
{
- DataArray::reprWithoutNameStream(stream);
+ this->reprWithoutNameStream(stream);
ImplReprTraits<T>::SetPrecision(stream);
this->_mem.reprNotTooLong(this->getNumberOfComponents(),stream);
}
template<class T>
int DataArrayDiscrete<T>::getHashCode() const
{
- DataArrayTemplate<T>::checkAllocated();
- std::size_t nbOfElems(DataArrayTemplate<T>::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<T>::begin());
+ const T *pt(this->begin());
for(std::size_t i=0;i<nbOfElems;i+=delta)
ret0+=pt[i] & 0x1FFF;
return ret+ret0;
template<class T>
void DataArrayDiscrete<T>::reprCppStream(const std::string& varName, std::ostream& stream) const
{
- std::size_t nbTuples(DataArrayTemplate<T>::getNumberOfTuples()),nbComp(DataArray::getNumberOfComponents());
- const T *data(DataArrayTemplate<T>::getConstPointer());
+ std::size_t nbTuples(this->getNumberOfTuples()),nbComp(this->getNumberOfComponents());
+ const T *data(this->getConstPointer());
stream << Traits<T>::ArrayTypeName << " *" << varName << "=" << Traits<T>::ArrayTypeName << "::New();" << std::endl;
if(nbTuples*nbComp>=1)
{
}
else
stream << varName << "->alloc(" << nbTuples << "," << nbComp << ");" << std::endl;
- stream << varName << "->setName(\"" << DataArray::getName() << "\");" << std::endl;
+ stream << varName << "->setName(\"" << this->getName() << "\");" << std::endl;
}
/*!
{
static const std::size_t MAX_NB_OF_BYTE_IN_REPR=300;
stream << Traits<T>::ArrayTypeName << " C++ instance at " << this << ". ";
- if(DataArrayTemplate<T>::isAllocated())
+ if(this->isAllocated())
{
- std::size_t nbOfCompo(DataArray::getNumberOfComponents());
+ std::size_t nbOfCompo(this->getNumberOfComponents());
if(nbOfCompo>=1)
{
- std::size_t nbOfTuples(DataArrayTemplate<T>::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);
}
template<class T>
void DataArrayDiscrete<T>::reprQuickOverviewData(std::ostream& stream, std::size_t maxNbOfByteInRepr) const
{
- const T *data(DataArrayTemplate<T>::begin());
- std::size_t nbOfTuples(DataArrayTemplate<T>::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;
void DataArrayDiscrete<T>::writeVTK(std::ostream& ofs, int indent, const std::string& type, const std::string& nameInFile, DataArrayByte *byteArr) const
{
static const char SPACE[4]={' ',' ',' ',' '};
- DataArrayTemplate<T>::checkAllocated();
+ this->checkAllocated();
std::string idt(indent,' ');
- ofs << idt << "<DataArray type=\"" << type << "\" Name=\"" << nameInFile << "\" NumberOfComponents=\"" << DataArrayTemplate<T>::getNumberOfComponents() << "\"";
+ ofs << idt << "<DataArray type=\"" << type << "\" Name=\"" << nameInFile << "\" NumberOfComponents=\"" << this->getNumberOfComponents() << "\"";
if(byteArr)
{
ofs << " format=\"appended\" offset=\"" << byteArr->getNumberOfTuples() << "\">";
if(std::string(type)==Traits<T>::VTKReprStr)
{
- const char *data(reinterpret_cast<const char *>(DataArrayTemplate<T>::begin()));
- std::size_t sz(DataArrayTemplate<T>::getNbOfElems()*sizeof(T));
+ const char *data(reinterpret_cast<const char *>(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<char> tmp(new char[DataArrayTemplate<T>::getNbOfElems()]);
- std::copy(DataArrayTemplate<T>::begin(),DataArrayTemplate<T>::end(),(char *)tmp);
- byteArr->insertAtTheEnd((char *)tmp,(char *)tmp+DataArrayTemplate<T>::getNbOfElems());
+ INTERP_KERNEL::AutoPtr<char> 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<unsigned char> tmp(new unsigned char[DataArrayTemplate<T>::getNbOfElems()]);
- std::copy(DataArrayTemplate<T>::begin(),DataArrayTemplate<T>::end(),(unsigned char *)tmp);
- byteArr->insertAtTheEnd((unsigned char *)tmp,(unsigned char *)tmp+DataArrayTemplate<T>::getNbOfElems());
+ INTERP_KERNEL::AutoPtr<unsigned char> 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
}
else
{
- ofs << " RangeMin=\"" << DataArrayTemplate<T>::getMinValueInArray() << "\" RangeMax=\"" << DataArrayTemplate<T>::getMaxValueInArray() << "\" format=\"ascii\">\n" << idt;
- std::copy(DataArrayTemplate<T>::begin(),DataArrayTemplate<T>::end(),std::ostream_iterator<int>(ofs," "));
+ ofs << " RangeMin=\"" << this->getMinValueInArray() << "\" RangeMax=\"" << this->getMaxValueInArray() << "\" format=\"ascii\">\n" << idt;
+ std::copy(this->begin(),this->end(),std::ostream_iterator<int>(ofs," "));
}
ofs << std::endl << idt << "</DataArray>\n";
}