本文整理汇总了C++中LeafNode::CountItems方法的典型用法代码示例。如果您正苦于以下问题:C++ LeafNode::CountItems方法的具体用法?C++ LeafNode::CountItems怎么用?C++ LeafNode::CountItems使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LeafNode
的用法示例。
在下文中一共展示了LeafNode::CountItems方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
// GoToNext
status_t
ItemIterator::GoToNext(Item *item)
{
//PRINT(("ItemIterator::GoToNext()\n"));
LeafNode *node = NULL;
status_t error = _GetLeafNode(&node);
if (error == B_OK) {
//PRINT((" leaf node: %Ld\n", node->GetNumber()));
// get the leaf node on which the next item resides
int32 newIndex = fIndex + 1;
while (error == B_OK && newIndex >= node->CountItems()) {
error = fTreeIterator.GoToNextLeaf(&node);
newIndex = 0;
}
// got the node, get the item
if (error == B_OK) {
//PRINT((" leaf node now: %Ld\n", node->GetNumber()));
fIndex = newIndex;
//PRINT((" index now: %ld\n", fIndex));
if (item)
error = item->SetTo(node, fIndex);
}
}
//PRINT(("ItemIterator::GoToNext() done: %s\n", strerror(error)));
return error;
}