Files
scylladb/keys/full_position.hh
Ernest Zaslavsky d2c5765a6b treewide: Move keys related files to a new keys directory
As requested in #22102, #22103 and #22105 moved the files and fixed other includes and build system.

Moved files:
- clustering_bounds_comparator.hh
- keys.cc
- keys.hh
- clustering_interval_set.hh
- clustering_key_filter.hh
- clustering_ranges_walker.hh
- compound_compat.hh
- compound.hh
- full_position.hh

Fixes: #22102
Fixes: #22103
Fixes: #22105

Closes scylladb/scylladb#25082
2025-07-25 10:45:32 +03:00

50 lines
1.6 KiB
C++

/*
* Copyright (C) 2022-present ScyllaDB
*/
/*
* SPDX-License-Identifier: LicenseRef-ScyllaDB-Source-Available-1.0
*/
#pragma once
#include "keys/keys.hh"
#include "mutation/position_in_partition.hh"
struct full_position;
struct full_position_view {
const partition_key_view partition;
const position_in_partition_view position;
full_position_view(const full_position&);
full_position_view(const partition_key&, const position_in_partition_view);
};
struct full_position {
partition_key partition;
position_in_partition position;
full_position(full_position_view);
full_position(partition_key, position_in_partition);
operator full_position_view() {
return full_position_view(partition, position);
}
static std::strong_ordering cmp(const schema& s, const full_position& a, const full_position& b) {
partition_key::tri_compare pk_cmp(s);
if (auto res = pk_cmp(a.partition, b.partition); res != 0) {
return res;
}
position_in_partition::tri_compare pos_cmp(s);
return pos_cmp(a.position, b.position);
}
};
inline full_position_view::full_position_view(const full_position& fp) : partition(fp.partition), position(fp.position) { }
inline full_position_view::full_position_view(const partition_key& pk, const position_in_partition_view pos) : partition(pk), position(pos) { }
inline full_position::full_position(full_position_view fpv) : partition(fpv.partition), position(fpv.position) { }
inline full_position::full_position(partition_key pk, position_in_partition pos) : partition(std::move(pk)), position(pos) { }