11struct ConcretePhysicalPlanTableEntry;
20template<
bool Ref,
bool C>
21requires (not Ref) or C
30 static constexpr bool IsReference = Ref;
36#ifdef M_ENABLE_SANITY_FIELDS
46#ifdef M_ENABLE_SANITY_FILEDS
50 M_insist(idx <= iterable.size(),
"invalid index");
57#ifdef M_ENABLE_SANITY_FILEDS
58 M_insist(current_ < end_,
"cannot increment end iterator");
66#ifdef M_ENABLE_SANITY_FILEDS
67 M_insist(current_ < end_,
"cannot dereference end iterator");
70 if constexpr (IsReference)
71 return current_->get();
77#ifdef M_ENABLE_SANITY_FILEDS
78 M_insist(current_ < end_,
"cannot dereference end iterator");
108 std::vector<std::reference_wrapper<const detail::condition_entry_t<entry_type>>>
children_;
112 template<
typename It>
126 {
swap(*
this, other); }
147 ConcreteCondition2PPTEntryMap, detail::Condition2PPTEntryMapIterator, ConcretePhysicalPlanTableEntry
163 std::vector<detail::condition_entry_t<entry_type>>
map_;
169 {
swap(*
this, other); }
179 map_.emplace_back(std::move(condition), std::move(entry));
202 std::vector<condition2entry_map_type>
table_;
#define M_CONSTEXPR_COND(COND, IF_TRUE, IF_FALSE)
ConcretePhysicalPlanTableIterator< false, C > Condition2PPTEntryMapIterator
const_iterator cend() const
std::vector< detail::condition_entry_t< entry_type > > map_
ConcreteCondition2PPTEntryMap(ConcreteCondition2PPTEntryMap &&other)
const_iterator end() const
void insert(ConditionSet &&condition, entry_type &&entry)
ConcreteCondition2PPTEntryMap()=default
const_iterator cbegin() const
super::const_iterator const_iterator
const_iterator begin() const
friend void swap(ConcreteCondition2PPTEntryMap &first, ConcreteCondition2PPTEntryMap &second)
super::entry_type entry_type
ConcreteCondition2PPTEntryMap & operator=(ConcreteCondition2PPTEntryMap other)
unsharable_shared_ptr< MatchBase > extract_match()
const_child_iterator end_children() const
unsharable_shared_ptr< MatchBase > match_
the found match; as unsharable shared pointer to share sub-matches between entries while being able ...
super::cost_type cost_type
unsharable_shared_ptr< MatchBase > share_match() const
friend void swap(ConcretePhysicalPlanTableEntry &first, ConcretePhysicalPlanTableEntry &second)
ConcretePhysicalPlanTableEntry(ConcretePhysicalPlanTableEntry &&other)
const_child_iterator begin_children() const
super::const_child_iterator const_child_iterator
cost_type cost_
cumulative cost, i.e. cost of the physical operator itself plus costs of its children
ConcretePhysicalPlanTableEntry()=default
const MatchBase & match() const
ConcretePhysicalPlanTableEntry & operator=(ConcretePhysicalPlanTableEntry other)
ConcretePhysicalPlanTableEntry(std::unique_ptr< MatchBase > &&match, const std::vector< It > &children, cost_type cost)
std::vector< std::reference_wrapper< const detail::condition_entry_t< entry_type > > > children_
all children, i.e. condition and entry per child
const_child_iterator cbegin_children() const
const_child_iterator cend_children() const
condition2entry_map_type & back()
ConcretePhysicalPlanTable(ConcretePhysicalPlanTable &&other)
condition2entry_map_type & operator[](size_type idx)
super::size_type size_type
const condition2entry_map_type & operator[](size_type idx) const
friend void swap(ConcretePhysicalPlanTable &first, ConcretePhysicalPlanTable &second)
super::condition2entry_map_type condition2entry_map_type
ConcretePhysicalPlanTable()=default
std::vector< condition2entry_map_type > table_
const condition2entry_map_type & back() const
ConcretePhysicalPlanTable & operator=(ConcretePhysicalPlanTable other)
void resize(size_type size)
Interface for a mapping between ConditionSets and physical plan table entries of type.
ConcretePhysicalPlanTableEntry entry_type
iterator_type< false > iterator
iterator_type< true > const_iterator
Interface for a single physical plan table entry.
range< const_child_iterator > children() const
child_iterator_type< true > const_child_iterator
Interface for an entire physical plan table containing a ConditionSet-entry-mapping.
ConcreteCondition2PPTEntryMap condition2entry_map_type
ConcretePhysicalPlanTableIterator & operator++()
reference operator*() const
bool operator!=(const ConcretePhysicalPlanTableIterator &other) const
ConcretePhysicalPlanTableIterator(const std::vector< iterable_entry_type > &iterable, std::size_t idx)
std::vector< iterable_entry_type >::iterator iterator_type
pointer operator->() const
iterator_type current_
the iterator to the current position in the iterable
iterator_type::difference_type difference_type
bool operator==(const ConcretePhysicalPlanTableIterator &other) const
ConcretePhysicalPlanTableIterator operator++(int)
super::reference reference
ConcretePhysicalPlanTableIterator()=default
std::conditional_t< IsReference, std::reference_wrapper< const value_type >, value_type > iterable_entry_type
Iterator interface to iterate over pairs of ConditionSet and.
std::conditional_t< IsConst, const value_type *, value_type * > pointer
std::conditional_t< IsConst, const value_type &, value_type & > reference
This class extends std::shared_ptr to allow for unsharing an exclusively held object and thereby conv...