本文整理汇总了C++中UtlHashMap::numberOfBuckets方法的典型用法代码示例。如果您正苦于以下问题:C++ UtlHashMap::numberOfBuckets方法的具体用法?C++ UtlHashMap::numberOfBuckets怎么用?C++ UtlHashMap::numberOfBuckets使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UtlHashMap
的用法示例。
在下文中一共展示了UtlHashMap::numberOfBuckets方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: value
UtlContainable* UtlHashMapIterator::value() const
{
UtlContainable* currentValue = NULL;
UtlContainer::acquireIteratorConnectionLock();
OsLock take(const_cast<OsBSem&>(mContainerRefLock));
UtlHashMap* myHashMap = dynamic_cast<UtlHashMap*>(mpMyContainer);
if (myHashMap)
{
OsLock container(myHashMap->mContainerLock);
UtlContainer::releaseIteratorConnectionLock();
if ( (mPosition < myHashMap->numberOfBuckets())
&& (mpCurrentPair)
&& (mPairIsValid)
)
{
currentValue = ( mpCurrentPair->value != UtlHashMap::INTERNAL_NULL
? mpCurrentPair->value
: NULL
);
}
}
else
{
UtlContainer::releaseIteratorConnectionLock();
}
return currentValue;
}
示例2: key
UtlContainable* UtlHashMapIterator::key() const
{
UtlContainable* currentKey = NULL;
UtlContainer::acquireIteratorConnectionLock();
OsLock take(const_cast<OsBSem&>(mContainerRefLock));
UtlHashMap* myHashMap = dynamic_cast<UtlHashMap*>(mpMyContainer);
if (myHashMap)
{
OsLock container(myHashMap->mContainerLock);
UtlContainer::releaseIteratorConnectionLock();
if ( (mPosition < myHashMap->numberOfBuckets())
&& (mpCurrentPair)
&& (mPairIsValid)
)
{
currentKey = mpCurrentPair->data;
}
}
else
{
UtlContainer::releaseIteratorConnectionLock();
}
return currentKey;
}
示例3: operator
UtlContainable* UtlHashMapIterator::operator()()
{
UtlContainable* foundKey = NULL;
UtlContainer::acquireIteratorConnectionLock();
OsLock take(mContainerRefLock);
UtlHashMap* myHashMap = dynamic_cast<UtlHashMap*>(mpMyContainer);
if (myHashMap)
{
OsLock container(myHashMap->mContainerLock);
UtlContainer::releaseIteratorConnectionLock();
if (mPosition < myHashMap->numberOfBuckets())
{
UtlPair* pair;
for ( pair = ( mpCurrentPair
? static_cast<UtlPair*>(mpCurrentPair->UtlChain::next)
: static_cast<UtlPair*>(myHashMap->mpBucket[mPosition].listHead())
);
!pair && ++mPosition < myHashMap->numberOfBuckets();
pair = static_cast<UtlPair*>(myHashMap->mpBucket[mPosition].listHead())
)
{
}
if(pair)
{
mpCurrentPair = pair;
foundKey = pair->data;
}
}
else
{
// mPosition >= myHashMap->numberOfBuckets(), so we've run off the end of the entries.
mpCurrentPair = NULL;
}
}
else
{
UtlContainer::releaseIteratorConnectionLock();
}
return foundKey;
}