10#include <unordered_map>
14#include <userver/formats/bson/types.hpp>
15#include <userver/formats/common/iterator_direction.hpp>
17USERVER_NAMESPACE_BEGIN
19namespace formats::
bson {
25 using iterator_category = std::forward_iterator_tag;
26 using difference_type = ptrdiff_t;
27 using value_type = std::remove_const_t<ValueType>;
28 using reference = ValueType&;
29 using pointer = ValueType*;
32 using NativeIter = std::variant<
33 impl::ParsedArray::const_iterator,
34 impl::ParsedArray::const_reverse_iterator,
35 impl::ParsedDocument::const_iterator>;
37 Iterator(impl::ValueImpl&, NativeIter);
40 Iterator(
const Iterator&);
41 Iterator(Iterator&&)
noexcept;
42 Iterator& operator=(
const Iterator&);
43 Iterator& operator=(Iterator&&)
noexcept;
47 Iterator operator++(
int);
48 Iterator& operator++();
49 reference operator*()
const;
50 pointer operator->()
const;
52 bool operator==(
const Iterator&)
const;
53 bool operator!=(
const Iterator&)
const;
58 template <
typename T =
void>
62 "Reverse iterator should be used only on arrays or null, "
63 "they do not have GetName()"
73 std::string GetNameImpl()
const;
74 void UpdateValue()
const;
76 impl::ValueImpl* iterable_;
78 mutable std::optional<value_type> current_;