24#if defined(__cpp_lib_format)
58 template <std::ranges::sized_range T>
65 template <
class U =
typename L::inner_value_type>
66 requires std::assignable_from<U&, const char*>
79 template <std::ranges::input_range T>
83 template <
class U =
typename L::inner_value_type>
84 requires std::assignable_from<U&, const char*>
87 template <std::ranges::input_range T>
91 template <
class U =
typename L::inner_value_type>
92 requires std::assignable_from<U&, const char*>
100 L* p_layout =
nullptr;
107 template <
typename Layout,
template <
typename>
typename TQual,
template <
typename>
typename UQual>
108 struct basic_common_reference<
sparrow::variable_size_binary_reference<Layout>, std::string, TQual, UQual>
113 template <
typename Layout,
template <
typename>
typename TQual,
template <
class>
class UQual>
119 template <
typename Layout,
template <
typename>
typename TQual,
template <
typename>
typename UQual>
120 struct basic_common_reference<
sparrow::variable_size_binary_reference<Layout>, std::vector<std::byte>, TQual, UQual>
122 using type = std::vector<std::byte>;
125 template <
typename Layout,
template <
typename>
typename TQual,
template <
class>
class UQual>
128 using type = std::vector<std::byte>;
146 template <std::ranges::sized_range T>
150 p_layout->assign(std::forward<T>(rhs), m_index);
151 p_layout->get_arrow_proxy().update_buffers();
157 requires std::assignable_from<U&, const char*>
160 return *
this = std::string_view(rhs);
166 return static_cast<size_type>(offset(m_index + 1) - offset(m_index));
172 return iterator(p_layout->data(uoffset(m_index)));
178 return iterator(p_layout->data(uoffset(m_index + 1)));
206 template <std::ranges::input_range T>
210 return std::equal(
cbegin(),
cend(), std::cbegin(rhs), std::cend(rhs));
215 requires std::assignable_from<U&, const char*>
222 template <std::ranges::input_range T>
226 return lexicographical_compare_three_way(*
this, rhs);
231 requires std::assignable_from<U&, const char*>
238 auto variable_size_binary_reference<L>::offset(size_type index)
const -> offset_type
240 return *(p_layout->offset(index));
244 auto variable_size_binary_reference<L>::uoffset(size_type index)
const -> size_type
246 return static_cast<size_type
>(offset(index));
250#if defined(__cpp_lib_format)
251template <
typename Layout>
252struct std::formatter<
sparrow::variable_size_binary_reference<Layout>>
254 constexpr auto parse(std::format_parse_context& ctx)
259 auto format(
const sparrow::variable_size_binary_reference<Layout>& ref, std::format_context& ctx)
const
264 [&ctx](
const auto& value)
266 std::format_to(ctx.out(),
"{}, ", value);
270 return std::format_to(ctx.out(),
"{}>", *std::prev(ref.
cend()));
274template <
typename Layout>
277 os << std::format(
"{}", value);
Implementation of reference to inner type used for layout L.
const_iterator cbegin() const
std::ptrdiff_t difference_type
typename array_type::size_type size_type
variable_size_binary_reference(L *layout, size_type index)
typename array_type::data_iterator iterator
typename array_type::inner_const_reference const_reference
auto operator<=>(const T &rhs) const
auto operator<=>(const char *rhs) const
variable_size_binary_reference(variable_size_binary_reference &&)=default
bool operator==(const T &rhs) const
bool operator==(const char *rhs) const
variable_size_binary_reference< array_type > self_type
typename array_type::const_data_iterator const_iterator
typename array_type::inner_value_type value_type
typename array_type::offset_type offset_type
variable_size_binary_reference(const variable_size_binary_reference &)=default
self_type & operator=(T &&rhs)
const_iterator end() const
const_iterator cend() const
typename array_type::inner_reference reference
const_iterator begin() const
self_type & operator=(const char *rhs)
Matches range types From whose elements are convertible to elements of range type To.
constexpr std::compare_three_way_result_t< typename cloning_ptr< T1 >::pointer, typename cloning_ptr< T2 >::pointer > operator<=>(const cloning_ptr< T1 > &lhs, const cloning_ptr< T2 > &rhs) noexcept
SPARROW_API bool operator==(const array &lhs, const array &rhs)
Compares the content of two arrays.
constexpr InputIt next(InputIt it, Distance n)
std::ostream & operator<<(std::ostream &stream, T n)
std::vector< std::byte > type
std::vector< std::byte > type