to fade out KeyT, so we can have more straightforward definitions.
Signed-off-by: Kefu Chai <tchaikov@gmail.com>
static node_offset_t header_size() { return 0u; }
- template <KeyT KT>
+ template <IsFullKey Key>
static node_offset_t estimate_insert(
- const full_key_t<KT>& key, const value_input_t&) {
+ const Key& key, const value_input_t&) {
return ns_oid_view_t::estimate_size(key) + sizeof(node_offset_t);
}
static node_offset_t header_size() { return FieldType::HEADER_SIZE; }
- template <KeyT KT>
+ template <IsFullKey Key>
static node_offset_t estimate_insert(
- const full_key_t<KT>& key, const value_input_t& value) {
+ const Key& key, const value_input_t& value) {
auto size = FieldType::estimate_insert_one();
if constexpr (FIELD_TYPE == field_type_t::N2) {
size += ns_oid_view_t::estimate_size(key);
return container_t::header_size();
}
- template <KeyT KT>
+ template <IsFullKey Key>
static node_offset_t estimate_insert(
- const full_key_t<KT>& key, const value_input_t& value) {
- return container_t::template estimate_insert<KT>(key, value);
+ const Key& key, const value_input_t& value) {
+ return container_t::estimate_insert(key, value);
}
private:
return container_t::header_size();
}
- template <KeyT KT>
- static node_offset_t estimate_insert(const full_key_t<KT>& key,
+ template <IsFullKey Key>
+ static node_offset_t estimate_insert(const Key& key,
const value_input_t& value) {
- return container_t::template estimate_insert<KT>(key, value);
+ return container_t::estimate_insert(key, value);
}
private:
static node_offset_t insert_size(const full_key_t<KT>& key,
const value_input_t& value) {
if constexpr (IS_BOTTOM) {
- return iterator_t::template estimate_insert<KT>(key, value);
+ return iterator_t::estimate_insert(key, value);
} else {
- return iterator_t::template estimate_insert<KT>(key, value) +
+ return iterator_t::estimate_insert(key, value) +
NXT_STAGE_T::iterator_t::header_size() +
NXT_STAGE_T::template insert_size<KT>(key, value);
}
index_t index, node_offset_t size, const char* p_left_bound)
{
assert(index <= sub_items.keys());
- assert(size == estimate_insert<KT>(key, value));
+ assert(size == estimate_insert(key, value));
const char* p_shift_start = p_left_bound;
const char* p_shift_end = reinterpret_cast<const char*>(
sub_items.p_first_item + 1 - index);
index_t index, node_offset_t size, const char* p_left_bound)
{
assert(index <= sub_items.keys());
- assert(size == estimate_insert<KT>(key, value));
+ assert(size == estimate_insert(key, value));
// a. [... item(index)] << size
const char* p_shift_start = p_left_bound;
const char* p_shift_end = sub_items.get_item_end(index);
static node_offset_t header_size() { return 0u; }
- template <KeyT KT>
+ template <IsFullKey Key>
static node_offset_t estimate_insert(
- const full_key_t<KT>&, const laddr_t&) {
+ const Key&, const laddr_t&) {
return sizeof(internal_sub_item_t);
}
static node_offset_t header_size() { return sizeof(num_keys_t); }
- template <KeyT KT>
+ template <IsFullKey Key>
static node_offset_t estimate_insert(
- const full_key_t<KT>&, const value_config_t& value) {
+ const Key&, const value_config_t& value) {
return value.allocation_size() + sizeof(snap_gen_t) + sizeof(node_offset_t);
}