souffle  2.0.2-371-g6315b36
Public Member Functions
souffle::detail::brie::fix_binding< Len, Pos, Dim > Struct Template Reference

A functor initializing an iterator upon creation to reference the first element exhibiting a given prefix within a given Trie. More...

#include <Brie.h>

Collaboration diagram for souffle::detail::brie::fix_binding< Len, Pos, Dim >:
Collaboration graph

Public Member Functions

template<unsigned bits, typename iterator , typename entry_type >
bool operator() (const SparseBitMap< bits > &store, iterator &begin, iterator &end, const entry_type &entry) const
 
template<typename Store , typename iterator , typename entry_type >
bool operator() (const Store &store, iterator &begin, iterator &end, const entry_type &entry) const
 

Detailed Description

template<unsigned Len, unsigned Pos, unsigned Dim>
struct souffle::detail::brie::fix_binding< Len, Pos, Dim >

A functor initializing an iterator upon creation to reference the first element exhibiting a given prefix within a given Trie.

Definition at line 2268 of file Brie.h.

Member Function Documentation

◆ operator()() [1/2]

template<unsigned Len, unsigned Pos, unsigned Dim>
template<unsigned bits, typename iterator , typename entry_type >
bool souffle::detail::brie::fix_binding< Len, Pos, Dim >::operator() ( const SparseBitMap< bits > &  store,
iterator &  begin,
iterator &  end,
const entry_type &  entry 
) const
inline

Definition at line 2270 of file Brie.h.

2275  {
2276  // search in current level
2277  auto cur = store.find(entry[Pos]);
2278 
2279  // if not present => fail
2280  if (cur == store.end()) return false;
2281 
2282  // take current value as start
2283  get_nested_iter_core<Pos>()(begin.iter_core).setIterator(cur);
2284 
2285  // update iterator value
2286  begin.value[Pos] = entry[Pos];
2287 
2288  // fix remaining nested iterators

◆ operator()() [2/2]

template<unsigned Len, unsigned Pos, unsigned Dim>
template<typename Store , typename iterator , typename entry_type >
bool souffle::detail::brie::fix_binding< Len, Pos, Dim >::operator() ( const Store &  store,
iterator &  begin,
iterator &  end,
const entry_type &  entry 
) const
inline

Definition at line 2291 of file Brie.h.

2292  {
2293  ++cur;
2294  if (cur != store.end()) {
2295  fix_first<Pos + 1, Dim>()(cur->second->getStore(), end);
2296  }
2297  }
2298  get_nested_iter_core<Pos>()(end.iter_core).setIterator(cur);
2299 
2300  // done
2301  return res;
2302  }
2303 };
2304 
2305 template <unsigned Pos, unsigned Dim>
2306 struct fix_binding<0, Pos, Dim> {
2307  template <unsigned bits, typename iterator, typename entry_type>
2308  bool operator()(const SparseBitMap<bits>& store, iterator& begin, iterator& /* end */,
2309  const entry_type& /* entry */) const {
2310  // move begin to begin of store
2311  auto a = store.begin();
2312  get_nested_iter_core<Pos>()(begin.iter_core).setIterator(a);
2313  begin.value[Pos] = *a;
2314 
2315  return true;
2316  }
2317 
2318  template <typename Store, typename iterator, typename entry_type>

The documentation for this struct was generated from the following file:
souffle::detail::brie::fix_binding::operator()
bool operator()(const SparseBitMap< bits > &store, iterator &begin, iterator &end, const entry_type &entry) const
Definition: Brie.h:2270