Skip to content

Commit

Permalink
Fix references and types
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-PLACET committed Apr 3, 2024
1 parent 90ef2a8 commit 64815c5
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions include/sparrow/dictionary_encoded_layout.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ namespace sparrow
template <class IL, class SL, bool is_const>
class dictionary_value_iterator : public iterator_base<
dictionary_value_iterator<IL, SL, is_const>,
typename SL::const_reference,
typename SL::value_type,
std::random_access_iterator_tag,
typename SL::const_reference>
{
Expand All @@ -43,7 +43,7 @@ namespace sparrow
using self_type = dictionary_value_iterator<IL, SL, is_const>;
using base_type = iterator_base<
self_type,
typename SL::const_reference,
typename SL::value_type,
std::random_access_iterator_tag,
typename SL::const_reference>;
using reference = typename base_type::reference;
Expand All @@ -57,7 +57,7 @@ namespace sparrow
dictionary_value_iterator(index_iterator index_it, sub_layout_reference sub_layout_reference);

private:
SL::const_reference dereference() const;
reference dereference() const;
void increment();
void decrement();
void advance(difference_type n);
Expand Down Expand Up @@ -108,8 +108,8 @@ namespace sparrow
using inner_reference = reference_proxy<SL>;
using inner_const_reference = const_reference_proxy<SL>;
using bitmap_type = array_data::bitmap_type;
using bitmap_const_reference = typename bitmap_type::const_reference;
using value_type = reference_proxy<SL>;
using bitmap_const_reference = bitmap_type::const_reference;
using value_type = SL::value_type;
using reference = reference_proxy<SL>;
using const_reference = const_reference_proxy<SL>;
using size_type = std::size_t;
Expand Down Expand Up @@ -152,7 +152,7 @@ namespace sparrow
const_value_range values() const;

private:
const indexes_layout* get_const_indexes_layout() const;
const indexes_layout& get_const_indexes_layout() const;

const_value_iterator value_cbegin() const;
const_value_iterator value_cend() const;
Expand Down Expand Up @@ -189,7 +189,7 @@ namespace sparrow
}

template <class IL, class SL, bool is_const>
auto dictionary_value_iterator<IL, SL, is_const>::dereference() const -> SL::const_reference
auto dictionary_value_iterator<IL, SL, is_const>::dereference() const -> reference
{
assert(m_sub_layout_reference.has_value());
return (*m_sub_layout_reference).get()[*m_index_it];
Expand Down Expand Up @@ -273,37 +273,37 @@ namespace sparrow
template <std::integral T, class SL, layout_offset OT>
auto dictionary_encoded_layout<T, SL, OT>::bitmap() const -> const_bitmap_range
{
return get_const_indexes_layout()->bitmap();
return get_const_indexes_layout().bitmap();
}

template <std::integral T, class SL, layout_offset OT>
const typename dictionary_encoded_layout<T, SL, OT>::indexes_layout* dictionary_encoded_layout<T, SL, OT>::get_const_indexes_layout() const
const typename dictionary_encoded_layout<T, SL, OT>::indexes_layout& dictionary_encoded_layout<T, SL, OT>::get_const_indexes_layout() const
{
return const_cast<const indexes_layout*>(m_indexes_layout.get());
return *const_cast<const indexes_layout*>(m_indexes_layout.get());
}

template <std::integral T, class SL, layout_offset OT>
auto dictionary_encoded_layout<T, SL, OT>::cbegin() const -> const_iterator
{
return const_iterator(value_cbegin(), get_const_indexes_layout()->bitmap().begin());
return const_iterator(value_cbegin(), get_const_indexes_layout().bitmap().begin());
}

template <std::integral T, class SL, layout_offset OT>
auto dictionary_encoded_layout<T, SL, OT>::cend() const -> const_iterator
{
return const_iterator(value_cend(), get_const_indexes_layout()->bitmap().end());
return const_iterator(value_cend(), get_const_indexes_layout().bitmap().end());
}

template <std::integral T, class SL, layout_offset OT>
auto dictionary_encoded_layout<T, SL, OT>::value_cbegin() const -> const_value_iterator
{
return const_value_iterator(get_const_indexes_layout()->values().begin(), *m_sub_layout);
return const_value_iterator(get_const_indexes_layout().values().begin(), *m_sub_layout);
}

template <std::integral T, class SL, layout_offset OT>
auto dictionary_encoded_layout<T, SL, OT>::value_cend() const -> const_value_iterator
{
return const_value_iterator(get_const_indexes_layout()->values().end(), *m_sub_layout);
return const_value_iterator(get_const_indexes_layout().values().end(), *m_sub_layout);
}

template <std::integral T, class SL, layout_offset OT>
Expand Down

0 comments on commit 64815c5

Please sign in to comment.