#ifndef CT_CLOUDINDEXSTDVECTORT_HPP #define CT_CLOUDINDEXSTDVECTORT_HPP #include "ct_cloudindex/ct_cloudindexstdvectort.h" #include template CT_CloudIndexStdVectorT::CT_CloudIndexStdVectorT(const size_t &size) : CT_AbstractModifiableCloudIndexT() { this->internalSetSortType(CT_AbstractCloudIndex::SortedInAscendingOrder); _vector.resize(size); m_impl = new CT_CloudIndexStdVectorTMethodImpl(*this, _vector); } template CT_CloudIndexStdVectorT::~CT_CloudIndexStdVectorT() { delete m_impl; } template void CT_CloudIndexStdVectorT::setSortType(CT_AbstractCloudIndex::SortType type) { m_impl->setSortType(type); this->internalSetSortType(type); } template size_t CT_CloudIndexStdVectorT::size() const { return m_impl->size(); } template size_t CT_CloudIndexStdVectorT::memoryUsed() const { return size() * sizeof(ct_index_type); } template size_t CT_CloudIndexStdVectorT::indexAt(const size_t &i) const { return m_impl->indexAt(i); } template const ct_index_type& CT_CloudIndexStdVectorT::constIndexAt(const size_t &i) const { return m_impl->constIndexAt(i); } template size_t CT_CloudIndexStdVectorT::operator[](const size_t &i) const { return m_impl->indexAt(i); } template void CT_CloudIndexStdVectorT::indexAt(const size_t &i, size_t &index) const { return m_impl->indexAt(i, index); } template size_t CT_CloudIndexStdVectorT::first() const { return m_impl->first(); } template size_t CT_CloudIndexStdVectorT::last() const { return m_impl->last(); } template bool CT_CloudIndexStdVectorT::contains(const size_t &index) const { return m_impl->contains(index); } template size_t CT_CloudIndexStdVectorT::indexOf(const size_t &index) const { return m_impl->indexOf(index); } template size_t CT_CloudIndexStdVectorT::lowerBound(const size_t &value) const { return m_impl->lowerBound(value); } template size_t CT_CloudIndexStdVectorT::upperBound(const size_t &value) const { return m_impl->upperBound(value); } template void CT_CloudIndexStdVectorT::addIndex(const size_t &newIndex) { m_impl->addIndex(newIndex); } template void CT_CloudIndexStdVectorT::removeIndex(const size_t &index) { m_impl->removeIndex(index); } template void CT_CloudIndexStdVectorT::replaceIndex(const size_t &i, const ct_index_type &newIndex, const bool &verifyRespectSort) { m_impl->replaceIndex(i, newIndex, verifyRespectSort); } template void CT_CloudIndexStdVectorT::push_front(const size_t &newIndex) { m_impl->push_front(newIndex); } template void CT_CloudIndexStdVectorT::fill() { m_impl->fill(); } template void CT_CloudIndexStdVectorT::clear() { m_impl->clear(); } template void CT_CloudIndexStdVectorT::erase(const size_t &beginIndex, const size_t &sizes) { m_impl->erase(beginIndex, sizes); } template void CT_CloudIndexStdVectorT::resize(const size_t &newSize) { m_impl->resize(newSize); } template void CT_CloudIndexStdVectorT::reserve(const size_t &newSize) { m_impl->reserve(newSize); } template void CT_CloudIndexStdVectorT::removeIfOrShiftIf(typename CT_CloudIndexStdVectorT::FindIfFunction findIf, typename CT_CloudIndexStdVectorT::RemoveIfFunction removeIf, typename CT_CloudIndexStdVectorT::ShiftIfFunction shiftIf, const size_t &shiftValue, const bool &negativeShift, void *context) { m_impl->removeIfOrShiftIf(findIf, removeIf, shiftIf, shiftValue, negativeShift, context); } template void CT_CloudIndexStdVectorT::shiftAll(const size_t &offset, const bool &negativeOffset) { m_impl->shiftAll(offset, negativeOffset); } template void CT_CloudIndexStdVectorT::eraseBetweenAndShiftRest(const size_t &eraseBeginPos, const size_t &eraseSize, const size_t &offset, const bool &negativeOffset) { m_impl->eraseBetweenAndShiftRest(eraseBeginPos, eraseSize, offset, negativeOffset); } template CT_SharedPointer< std::vector > CT_CloudIndexStdVectorT::toStdVectorInt() const { // create a shared pointer that will not delete this vector (second parameter = false) return CT_SharedPointer< std::vector >(&const_cast&>(_vector), false); } template CT_AbstractCloud* CT_CloudIndexStdVectorT::copy() const { CT_CloudIndexStdVectorT *index = new CT_CloudIndexStdVectorT(size()); index->setSortType(this->sortType()); m_impl->copy(*index->internalData()); return index; } template typename std::vector::iterator CT_CloudIndexStdVectorT::vectorFindIf(typename CT_CloudIndexStdVectorT::FindIfFunction findIf, void *context) const { typename std::vector::iterator first = _vector.begin(); typename std::vector::iterator last = _vector.end(); size_t tmp; while (first!=last) { tmp = *first; if ((*findIf)(context, tmp)) return first; ++first; } return last; } template std::vector< ct_index_type >* CT_CloudIndexStdVectorT::internalData() const { return &const_cast< std::vector& >(_vector); } template void CT_CloudIndexStdVectorT::internalShiftAll(const size_t &offset, const bool &negativeOffset) { m_impl->internalShiftAll(offset, negativeOffset); } template void CT_CloudIndexStdVectorT::internalClear() { m_impl->internalClear(); } #endif // CT_CLOUDINDEXSTDVECTORT_HPP