10using IntervalTree = lib_interval_tree::interval_tree<IntervalType, EntityHooks>;
16 operator uint64_t()
const {
21 return (
static_cast<uint64_t
>(
line) << 32) |
column;
37 auto it =
tree.insert({start, end});
38 it.node()->payload = entity;
56 std::optional<uint64_t> highestStart = std::nullopt;
57 std::shared_ptr<bpp::bpp_entity> innermostEntity;
58 tree.overlap_find_all({point, point}, [&](
auto const& it) {
61 if (!highestStart.has_value() || it->low() > highestStart) {
62 highestStart = it->low();
63 innermostEntity = it.node()->payload;
67 return innermostEntity;
73 std::shared_ptr<bpp::bpp_entity>
find(uint32_t line, uint32_t column) {
lib_interval_tree::interval_tree< IntervalType, EntityHooks > IntervalTree
Definition EntityMap.h:10
Definition EntityMap.h:28
IntervalTree tree
Definition EntityMap.h:30
void insert(FilePosition start, FilePosition end, const std::shared_ptr< bpp::bpp_entity > &entity)
Add an entity to the entity map.
Definition EntityMap.h:36
std::shared_ptr< bpp::bpp_entity > find(uint32_t line, uint32_t column)
Find the active code entity at a specific line and column.
Definition EntityMap.h:73
std::shared_ptr< bpp::bpp_entity > find(FilePosition point)
Definition EntityMap.h:41
Definition EntityMap.h:12
uint32_t line
Definition EntityMap.h:13
FilePosition(uint32_t line, uint32_t column)
Definition EntityMap.h:24
uint32_t column
Definition EntityMap.h:14