本文整理汇总了C++中LeafNode::clone方法的典型用法代码示例。如果您正苦于以下问题:C++ LeafNode::clone方法的具体用法?C++ LeafNode::clone怎么用?C++ LeafNode::clone使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LeafNode
的用法示例。
在下文中一共展示了LeafNode::clone方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: begin
BPlusTreeIterator* BPlusTree::begin() {
BPlusTreeIterator* iterator = NULL;
LeafNode* leaf = static_cast <LeafNode*> (hidratateNode(firstLeaf));
if (leaf) {
iterator = new BPlusTreeIterator(leaf->clone(), 0, fileBlockManager);
freeNodeMemory(leaf);
}
return iterator;
}
示例2: getPosition
pair<Record*, BPlusTreeIterator*> BPlusTree::search(Key k) {
Node *aNode = root;
if (!aNode)
return pair<Record*, BPlusTreeIterator*> (NULL, NULL);
while (!aNode->isLeaf()) {
InnerNode *innerNode = static_cast<InnerNode*> (aNode);
int position = getPosition(innerNode, k);
aNode = hidratateNode(innerNode->sons[position]);
if (innerNode != root)
freeNodeMemory(innerNode);
}
LeafNode *leafNode = static_cast<LeafNode*> (aNode);
Record* record = NULL;
BPlusTreeIterator* iterator = NULL;
int pos = getPosition(leafNode, k);
if (pos < leafNode->keyMount && equalKey(k, leafNode->keys[pos])) {
record = new Record(leafNode->keys[pos].Clone(), new ByteString(leafNode->byteData[pos]));
iterator = new BPlusTreeIterator(leafNode->clone(), pos, fileBlockManager);
}
if (leafNode != root)
freeNodeMemory(leafNode);
return pair<Record*, BPlusTreeIterator*> (record, iterator);
}