/** * @brief Checks if the current chunk has enough items left. * * If the chunk has not enough items left, the next chunk is * loaded. * * @param items The maximum number of items to store. */ inline void reserveItems(const size_t items) { assert(items <= chunkSize); if(chunkSize < curChunk->getUsedSize() + items) { nextChunk(); } }
/** * @brief Checks if the current chunk has enough items left. * * If the chunk has not enough items left, the next chunk is * loaded. * * @param items The maximum number of items to store. */ CODI_INLINE void reserveItems(const size_t items) { codiAssert(items <= chunkSize); if(chunkSize < curChunk->getUsedSize() + items) { nextChunk(); } }
/** * @brief Get the total number of data items used. * @return The number of data items used in all chunks. */ inline size_t getDataSize() { size_t size = curChunk->getUsedSize(); if(getNumChunks() != 0) { size += (getNumChunks() - 1) * chunkSize; } return size; }
/** * @brief Get the position of the chunk vector and the nested vectors. * @return The position of the chunk vector. */ inline Position getPosition() { return Position(curChunkIndex, curChunk->getUsedSize(), nested.getPosition()); }
/** * @brief The position inside the data of the current chunk. * @return The current position in the current chunk. */ inline size_t getChunkPosition() { return curChunk->getUsedSize(); }
/** * @brief Get the position of the chunk vector and the nested vectors. * @return The position of the chunk vector. */ CODI_INLINE Position getPosition() const { return Position(curChunkIndex, curChunk->getUsedSize(), nested->getPosition()); }
/** * @brief The position inside the data of the current chunk. * @return The current position in the current chunk. */ CODI_INLINE size_t getChunkPosition() const { return curChunk->getUsedSize(); }