Lines Matching defs:element

46 // - Adding an element already present in the set is illegal. In debug mode,
52 // element.
61 // searching for an element we ensure the elements are sorted (this is generally
62 // the case) and perform a binary search. When deleting an element we do not
63 // free the associated memory immediately. Instead, an element to be deleted is
110 // It is illegal to insert an element already present in the set.
111 void insert(const ElementType& element);
113 // Looks for the specified element in the set and - if found - deletes it.
115 size_t erase(const ElementType& element);
129 // This returns the key of the minimum element in the set.
132 static bool IsValid(const ElementType& element);
133 static KeyType GetKey(const ElementType& element);
134 static void SetKey(ElementType* element, KeyType key);
140 // Returns a pointer to the element in vector_ if it was found, or NULL
142 ElementType* Search(const ElementType& element);
144 // The argument *must* point to an element stored in *this* set.
147 void EraseInternal(ElementType* element);
150 ElementType* BinarySearch(const ElementType& element,
172 // Delete invalid trailing elements and return the last valid element in the
182 // Returns the index of the element within the backing storage. The element
184 size_t GetElementIndex(const ElementType* element) const;
186 // Returns the element at the specified index in the backing storage.
295 // Delete the current element and advance the iterator to point to the next
296 // element.
299 static bool IsValid(const ElementType& element);
300 static KeyType GetKey(const ElementType& element);
377 void InvalSet<TEMPLATE_INVALSET_P_DEF>::insert(const ElementType& element) {
379 VIXL_ASSERT(IsValid(element));
380 VIXL_ASSERT(Search(element) == NULL);
381 SetSorted(empty() || (sorted_ && (element > CleanBack())));
383 vector_->push_back(element);
386 preallocated_[size_] = element;
396 vector_->push_back(element);
401 if (valid_cached_min_ && (element < GetMinElement())) {
403 cached_min_key_ = GetKey(element);
414 size_t InvalSet<TEMPLATE_INVALSET_P_DEF>::erase(const ElementType& element) {
416 VIXL_ASSERT(IsValid(element));
417 ElementType* local_element = Search(element);
428 const ElementType& element) {
442 return BinarySearch(element, GetElementAt(cached_min_index_), StorageEnd());
491 bool InvalSet<TEMPLATE_INVALSET_P_DEF>::IsValid(const ElementType& element) {
492 return GetKey(element) != kInvalidKey;
497 void InvalSet<TEMPLATE_INVALSET_P_DEF>::EraseInternal(ElementType* element) {
500 VIXL_ASSERT(element != NULL);
501 size_t deleted_index = GetElementIndex(element);
503 VIXL_ASSERT((&(vector_->front()) <= element) &&
504 (element <= &(vector_->back())));
505 SetKey(element, kInvalidKey);
507 VIXL_ASSERT((preallocated_ <= element) &&
508 (element < (preallocated_ + kNPreallocatedElements)));
510 size_t copy_size = sizeof(*element) * (end - element - 1);
511 memmove(element, element + 1, copy_size);
517 const ElementType* min = GetFirstValidElement(element, StorageEnd());
530 const ElementType& element, ElementType* start, ElementType* end) const {
558 if (elements[middle] < element) {
565 if (elements[low] == element) return &elements[low];
566 if (elements[high] == element) return &elements[high];
691 const ElementType* element) const {
692 VIXL_ASSERT((StorageBegin() <= element) && (element < StorageEnd()));
693 return element - StorageBegin();
844 bool InvalSetIterator<S>::IsValid(const ElementType& element) {
845 return S::IsValid(element);
850 typename S::_KeyType InvalSetIterator<S>::GetKey(const ElementType& element) {
851 return S::GetKey(element);