Bash++
Bash++ compiler internal documentation
EntityNode.h
Go to the documentation of this file.
1
6#pragma once
7#include "interval_tree.hpp"
8#include "tree_hooks.hpp"
9#include <cstdint>
10#include <memory>
11#include "../../bpp_include/bpp.h"
12
13// Forward decl.
14namespace bpp {
15class bpp_entity;
16}
17
18using IntervalType = lib_interval_tree::interval<uint64_t, lib_interval_tree::closed>;
19
20struct EntityNode : lib_interval_tree::node<uint64_t, IntervalType, EntityNode> {
21 using base_type = lib_interval_tree::node<uint64_t, IntervalType, EntityNode>;
22 using interval_type = typename base_type::interval_type;
23
24 std::shared_ptr<bpp::bpp_entity> payload;
25
27 : base_type(parent, std::move(interval)) {}
28};
29
30struct EntityHooks : lib_interval_tree::hooks::regular {
32
33 template <typename IteratorT>
34 static inline bool on_find(IteratorT) noexcept { return true; }
35
36 template <typename IteratorT>
37 static inline bool on_overlap_find_all(
38 std::conditional<true,
39 lib_interval_tree::interval_tree<lib_interval_tree::interval<uint64_t,
40 lib_interval_tree::closed>,
42 const lib_interval_tree::interval_tree<lib_interval_tree::interval<uint64_t,
43 lib_interval_tree::closed>,
45 >::type&,
46 lib_interval_tree::interval_tree<lib_interval_tree::interval<uint64_t,
47 lib_interval_tree::closed>,
49 const lib_interval_tree::interval_tree<lib_interval_tree::interval<uint64_t,
50 lib_interval_tree::closed>,
51 EntityHooks>::interval_type&
52 ) noexcept { return true; }
53};
54
lib_interval_tree::interval< uint64_t, lib_interval_tree::closed > IntervalType
Definition EntityNode.h:18
Definition bash_case.cpp:8
Definition EntityNode.h:30
static bool on_overlap_find_all(std::conditional< true, lib_interval_tree::interval_tree< lib_interval_tree::interval< uint64_t, lib_interval_tree::closed >, EntityHooks >, const lib_interval_tree::interval_tree< lib_interval_tree::interval< uint64_t, lib_interval_tree::closed >, EntityHooks > >::type &, lib_interval_tree::interval_tree< lib_interval_tree::interval< uint64_t, lib_interval_tree::closed >, EntityHooks >::node_type *&, const lib_interval_tree::interval_tree< lib_interval_tree::interval< uint64_t, lib_interval_tree::closed >, EntityHooks >::interval_type &) noexcept
Definition EntityNode.h:37
EntityNode node_type
Definition EntityNode.h:31
static bool on_find(IteratorT) noexcept
Definition EntityNode.h:34
Definition EntityNode.h:20
EntityNode(EntityNode *parent, interval_type interval)
Definition EntityNode.h:26
typename base_type::interval_type interval_type
Definition EntityNode.h:22
lib_interval_tree::node< uint64_t, IntervalType, EntityNode > base_type
Definition EntityNode.h:21
std::shared_ptr< bpp::bpp_entity > payload
Definition EntityNode.h:24