///
typedef _Weight weight_type;
-
+
/// Second template parameter: The data type associated with each
/// key. Stored in the B+ tree's leaves
typedef _Data data_type;
return iterator(leaf, slot);
}
- /// Searches the B+ tree and returns an iterator to the first summed weight
+ /// Searches the B+ tree and returns an iterator to the first summed weight
/// less or equal to the parameter. If unsuccessful it returns end().
iterator lower_summed_weight_bound(weight_type weight)
{
node *n = root;
if (!n) return end();
-
+
while(!n->isleafnode()) {
const inner_node *inner = static_cast<const inner_node*>(n);
int slot = find_summed_weight_lower(inner, weight);
return const_iterator(leaf, slot);
}
- /// Searches the B+ tree and returns an iterator to the first summed weight
+ /// Searches the B+ tree and returns an iterator to the first summed weight
/// less or equal to the parameter. If unsuccessful it returns end().
const_iterator lower_summed_weight_bound(weight_type weight) const
{
return const_iterator(leaf, slot);
}
- /// Searches the B+ tree and returns an iterator to the first summed weight
+ /// Searches the B+ tree and returns an iterator to the first summed weight
/// greater than the parameter. If unsuccessful it returns end().
iterator upper_summed_weight_bound(weight_type weight)
{
return iterator(leaf, slot);
}
- /// Searches the B+ tree and returns an iterator to the first summed weight
+ /// Searches the B+ tree and returns an iterator to the first summed weight
/// greater than the parameter. If unsuccessful it returns end().
const_iterator upper_summed_weight_bound(weight_type weight) const
{
clear();
key_less = other.key_comp();
- if (other.size() != 0)
+ if (!other.empty())
{
stats.leaves = stats.innernodes = 0;
root = copy_recursive(other.root);
stats( other.stats ),
key_less( other.key_comp() )
{
- if (size() > 0)
+ if (!empty())
{
stats.leaves = stats.innernodes = 0;
root = copy_recursive(other.root);
slot -= inner->slotuse+1;
inner = static_cast<inner_node*>(*splitnode);
- BTREE_PRINT("btree::insert_descend switching to splitted node " << inner << " slot " << slot <<std::endl);
+ BTREE_PRINT("btree::insert_descend switching to split node " << inner << " slot " << slot <<std::endl);
}
}