Esempio n. 1
0
  ConstIterator Find(const T2& value)const
  {
	  uint32_t hashCode=value.getHashCode();
	  uint32_t hidx = hashCode%hashSize;

	  Node*const* nodePtr=&hash[hidx];
	  if(!*nodePtr)
		  return ConstIterator(0);

	  if(value.IsSameState(*((*nodePtr)->m_UserState)))
	  {
		  return ConstIterator(this,hidx,*nodePtr,nodePtr);
	  }
	  Node*const* parentPtr=nodePtr;
	  Node* node=(Node*)(*nodePtr)->ihsNextNode;
	  while(node)
	  {
		  if(value.IsSameState(*(node->m_UserState)))
		  {
			  return ConstIterator(this,hidx,node,parentPtr);
		  }
		  parentPtr=nodePtr;
		  nodePtr=(Node**)&node->ihsNextNode;
		  node=(Node*)node->ihsNextNode;
	  }
	  return ConstIterator(0);
  }
Esempio n. 2
0
 const ConstIterator
 begin() const
 {
     return ConstIterator(
         reinterpret_cast<const ConstLink*>(get_head_unsafe())
     );
 }
Esempio n. 3
0
File: map.hpp Progetto: Nikhil14/Map
typename Map<T,H>::ConstIterator Map<T,H>::find(const_Key& other) const
{
    Node *n  = this->root;
    while(n!=nullptr)
    {
        if(n->pair_obj->first > other)
        {
            n = n->left;
        }
        else if(n->pair_obj->first < other)
        {
            n = n->right;
        }
        else if(n->pair_obj->first == other)
        {
            return (ConstIterator(n));
        }
    } 
    return ConstIterator(this->tail);
}
Esempio n. 4
0
Collection::ConstIterator Collection::find(const Variant& key) const
{
	if (impl_)
	{
		return impl_->get(key, CollectionImplBase::GET_EXISTING).first;
	}
	else
	{
		return ConstIterator();
	}
}
Esempio n. 5
0
File: map.hpp Progetto: Nikhil14/Map
typename Map<T,H>::const_Value& Map<T,H>::at(const_Key& other) const
{
    //std::cout<<"Constant At\n";
    ConstIterator i = find(other);
    if( i == ConstIterator(this->tail))
    {   
        //std::cout<<"OUT of Range"<<'\n';
        throw std::out_of_range("Value Not Present\n");
    }
    else
    {
        return (i.iter_node->pair_obj->second);
    }
}
Esempio n. 6
0
 ConstIterator Find(const T& value)const
 {
   uint32_t hidx=getIndex(&value);
   Node*const* nodePtr=&hash[hidx];
   if(!*nodePtr)return ConstIterator(0);
   if(TRAITS::isEqual((*nodePtr),&value))
   {
     return ConstIterator(this,hidx,*nodePtr,nodePtr);
   }
   Node*const* parentPtr=nodePtr;
   Node* node=(Node*)(*nodePtr)->ihsNextNode;
   while(node)
   {
     if(TRAITS::isEqual(node,&value))
     {
       return ConstIterator(this,hidx,node,parentPtr);
     }
     parentPtr=nodePtr;
     nodePtr=(Node**)&node->ihsNextNode;
     node=(Node*)node->ihsNextNode;
   }
   return ConstIterator(0);
 }
Esempio n. 7
0
void
ChannelList::channelsWithPrefix (const char prefix[],
				 ConstIterator &first,
				 ConstIterator &last) const
{
    first = last = _map.lower_bound (prefix);
    int n = strlen (prefix);

    while (last != ConstIterator (_map.end()) &&
	   strncmp (last.name(), prefix, n) <= 0)
    {
	++last;
    }
}
Esempio n. 8
0
			ConstIterator find(const Key_T &key) const 
			{ 
				Node* current_node;
				Node* fallback_node = levels;

				for(int i = (MaxLevel - 1); i >= 0; i--)
				{
					current_node = fallback_node;
					while(current_node != NULL)
					{
						fallback_node = current_node;
						if(current_node->nodes[i] == NULL || current_node->nodes[i]->dataPair.first > key)
							break; // Next string on this node
						else if (current_node->nodes[i]->dataPair.first == key)
							return ConstIterator(current_node->nodes[i]);
						else if(current_node->nodes[i]->dataPair.first < key)
							current_node = current_node->nodes[i];
					}
				}
				return NULL;
			}
Esempio n. 9
0
 ConstIterator begin() const { return ConstIterator(mInit, mStep, mSize); }
Esempio n. 10
0
 /** Get an iterator pointing to the beginning of the matrix. */
 ConstIterator begin() const { return ConstIterator(*this, 0, 0); }
Esempio n. 11
0
 /** Get an iterator pointing to the end of the matrix. */
 ConstIterator end() const { return ConstIterator(*this, (this->numColumns() > 0 ? this->numRows() : 0), 0); }
Esempio n. 12
0
			ConstIterator end() const
			{ 
				Node* temp = levels->nodes[0];
				while(temp != NULL) temp = temp->nodes[0];
				return ConstIterator(temp);
			}
Esempio n. 13
0
	ConstIterator end() const
	{
		return ConstIterator(*this, endIt);
	}
Esempio n. 14
0
 ConstIterator operator()(BaseConstIterator iter) const
 {
     return ConstIterator(iter);
 }
Esempio n. 15
0
const PointListHandler::ConstIterator PointListHandler::end() const
{
	return ConstIterator(hash.end());
}
mitk::IsoDoseLevelSet::ConstIterator mitk::IsoDoseLevelSet::Begin(void) const
{
  return ConstIterator(this->m_IsoLevels.begin());
}
Esempio n. 17
0
typename List<Type>::ConstIterator List<Type>::end(void) const
{
    // return an constant iterator just past the end
    return ConstIterator(&_sentinel);
}
Esempio n. 18
0
typename List<Type>::ConstIterator List<Type>::begin(void) const
{
    // return an constant iterator to the beginning
    return ConstIterator(_sentinel.next());
}
Esempio n. 19
0
typename SortedVectorMapStore<V>::ConstIterator SortedVectorMapStore<V>::CBegin() {
  return ConstIterator(entries_.get(),
                       entries_.get() + sizeof(Entry<V>) * num_entries_);
}
Esempio n. 20
0
 const ConstIterator getRight() const {
     return ConstIterator( node_->getRight() );
 }
Esempio n. 21
0
 const ConstIterator getLeft() const {
     return ConstIterator( node_->getLeft() );
 }
Esempio n. 22
0
 ConstIterator end() const { return ConstIterator(mInit + mStep * mSize, mStep, 0); }
Esempio n. 23
0
 const ConstIterator
 begin() const
 {
     return ConstIterator(reinterpret_cast<const ConstLink*>(impl.get_head()));
 }
Esempio n. 24
0
 typename BasicTree<T>::ConstIterator BasicTree<T>::begin() const
 {
     return ConstIterator( *this );
 }
Esempio n. 25
0
 const ConstIterator
 end() const
 {
     return ConstIterator(nullptr);
 }
Esempio n. 26
0
typename Set<T>::ConstIterator Set<T>::cbegin() const
{
  return ConstIterator(map.cbegin());
}
Esempio n. 27
0
	ConstIterator begin() const
	{
		return ConstIterator(*this, beginIt);
	}
Esempio n. 28
0
typename Set<T>::ConstIterator Set<T>::cend() const
{
  return ConstIterator(map.cend());
}
mitk::IsoDoseLevelSet::ConstIterator mitk::IsoDoseLevelSet::End(void) const
{
  return ConstIterator(this->m_IsoLevels.end());
}
Esempio n. 30
0
			ConstIterator begin() const
			{ 
				return ConstIterator(levels->nodes[0]);
			}