예제 #1
0
    /**
     * @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();
      }
    }
예제 #2
0
    /**
     * @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();
      }
    }
예제 #3
0
    /**
     * @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;
    }
예제 #4
0
 /**
  * @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());
 }
예제 #5
0
 /**
  * @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();
 }
예제 #6
0
 /**
  * @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());
 }
예제 #7
0
 /**
  * @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();
 }