Lines Matching refs:index

44 	status_t Insert(const Value &value, int32 index);
48 Iterator Erase(int32 index);
61 inline Iterator IteratorForIndex(int32 index);
62 inline ConstIterator IteratorForIndex(int32 index) const;
64 inline const Value &ElementAt(int32 index) const;
65 inline Value &ElementAt(int32 index);
73 inline Value &operator[](int32 index);
74 inline const Value &operator[](int32 index) const;
279 \param offset The index to which the elements shall be moved. May be
293 /*! \brief Inserts a copy of the the supplied value at the given index.
295 \param index The index at which to insert the new element. It must
296 hold: 0 <= \a index <= Count().
299 - \c B_BAD_VALUE: \a index is out of range.
304 _VECTOR_CLASS_NAME::Insert(const Value &value, int32 index)
306 if (index < 0 || index > fItemCount)
310 _MoveItems(fItems + index, 1, fItemCount - index - 1);
311 new(fItems + index) Value(value);
329 int32 index = _IteratorIndex(iterator);
330 if (index >= 0)
331 return Insert(value, index);
355 /*! \brief Removes the element at the given index.
356 \param index The position of the element to be removed.
357 \return An iterator referring to the element now being located at index
358 \a index (End(), if it was the last element that has been
359 removed), or Null(), if \a index was out of range.
363 _VECTOR_CLASS_NAME::Erase(int32 index)
365 if (index >= 0 && index < fItemCount) {
366 fItems[index].~Value();
367 _MoveItems(fItems + index + 1, -1, fItemCount - index - 1);
369 return Iterator(fItems + index);
386 int32 index = _IteratorIndex(iterator);
387 if (index >= 0 && index < fItemCount)
388 return Erase(index);
525 /*! \brief Returns an iterator for a given index.
526 \return An iterator referring to the same element as \a index, or
527 End(), if \a index is out of range.
532 _VECTOR_CLASS_NAME::IteratorForIndex(int32 index)
534 if (index >= 0 && index <= fItemCount)
535 return Iterator(fItems + index);
540 /*! \brief Returns an iterator for a given index.
541 \return An iterator referring to the same element as \a index, or
542 End(), if \a index is out of range.
547 _VECTOR_CLASS_NAME::IteratorForIndex(int32 index) const
549 if (index >= 0 && index <= fItemCount)
550 return ConstIterator(fItems + index);
555 /*! \brief Returns the element at a given index.
556 \param index The index identifying the element to be returned.
557 \return The element identified by the given index.
562 _VECTOR_CLASS_NAME::ElementAt(int32 index) const
564 if (index >= 0 && index < fItemCount)
565 return fItems[index];
572 /*! \brief Returns the element at a given index.
573 \param index The index identifying the element to be returned.
574 \return The element identified by the given index.
579 _VECTOR_CLASS_NAME::ElementAt(int32 index)
581 if (index >= 0 && index < fItemCount)
582 return fItems[index];
589 /*! \brief Returns the index of the next element with the specified value.
591 \param start The index at which to be started to search for the element.
592 \return The index of the found element, or \c -1, if no further element
593 with the given value could be found or \a index is out of range.
637 int32 index = IndexOf(value, _IteratorIndex(start));
638 if (index >= 0)
639 return Iterator(fItems + index);
672 int32 index = IndexOf(value, _IteratorIndex(start));
673 if (index >= 0)
674 return ConstIterator(fItems + index);
684 _VECTOR_CLASS_NAME::operator[](int32 index)
686 return ElementAt(index);
695 _VECTOR_CLASS_NAME::operator[](int32 index) const
697 return ElementAt(index);
738 /*! \brief Returns index of the element the supplied iterator refers to.
739 \return The index of the element the supplied iterator refers to, or
749 int32 index = iterator.Element() - fItems;
750 if (index >= 0 && index <= fItemCount)
751 return index;
757 /*! \brief Returns index of the element the supplied iterator refers to.
758 \return The index of the element the supplied iterator refers to, or
768 int32 index = iterator.Element() - fItems;
769 if (index >= 0 && index <= fItemCount)
770 return index;