userver: formats::bson::Iterator< ValueType, Direction > Class Template Reference
Loading...
Searching...
No Matches
formats::bson::Iterator< ValueType, Direction > Class Template Referencefinal

#include <userver/formats/bson/iterator.hpp>

Detailed Description

template<typename ValueType, common::IteratorDirection Direction = common::IteratorDirection::kForward>
class formats::bson::Iterator< ValueType, Direction >

Iterator for BSON values.

Definition at line 23 of file iterator.hpp.

Public Types

using iterator_category = std::forward_iterator_tag
 
using difference_type = ptrdiff_t
 
using value_type = std::remove_const_t<ValueType>
 
using reference = ValueType&
 
using pointer = ValueType*
 

Public Member Functions

 Iterator (const Iterator &)
 
 Iterator (Iterator &&) noexcept
 
Iteratoroperator= (const Iterator &)
 
Iteratoroperator= (Iterator &&) noexcept
 
template<typename T = void>
std::string GetName () const
 Returns name of currently selected document field.
 
uint32_t GetIndex () const
 Returns index of currently selected array element.
 
Forward iterator requirements
Iterator operator++ (int)
 
Iteratoroperator++ ()
 
reference operator* () const
 
pointer operator-> () const
 
bool operator== (const Iterator &) const
 
bool operator!= (const Iterator &) const
 

Member Typedef Documentation

◆ difference_type

template<typename ValueType , common::IteratorDirection Direction = common::IteratorDirection::kForward>
using formats::bson::Iterator< ValueType, Direction >::difference_type = ptrdiff_t

Definition at line 26 of file iterator.hpp.

◆ iterator_category

template<typename ValueType , common::IteratorDirection Direction = common::IteratorDirection::kForward>
using formats::bson::Iterator< ValueType, Direction >::iterator_category = std::forward_iterator_tag

Definition at line 25 of file iterator.hpp.

◆ pointer

template<typename ValueType , common::IteratorDirection Direction = common::IteratorDirection::kForward>
using formats::bson::Iterator< ValueType, Direction >::pointer = ValueType*

Definition at line 29 of file iterator.hpp.

◆ reference

template<typename ValueType , common::IteratorDirection Direction = common::IteratorDirection::kForward>
using formats::bson::Iterator< ValueType, Direction >::reference = ValueType&

Definition at line 28 of file iterator.hpp.

◆ value_type

template<typename ValueType , common::IteratorDirection Direction = common::IteratorDirection::kForward>
using formats::bson::Iterator< ValueType, Direction >::value_type = std::remove_const_t<ValueType>

Definition at line 27 of file iterator.hpp.

Member Function Documentation

◆ GetIndex()

template<typename ValueType , common::IteratorDirection Direction = common::IteratorDirection::kForward>
uint32_t formats::bson::Iterator< ValueType, Direction >::GetIndex ( ) const

Returns index of currently selected array element.

Exceptions
TypeMismatchExceptionif iterated value is not an array

◆ GetName()

template<typename ValueType , common::IteratorDirection Direction = common::IteratorDirection::kForward>
template<typename T = void>
std::string formats::bson::Iterator< ValueType, Direction >::GetName ( ) const
inline

Returns name of currently selected document field.

Exceptions
TypeMismatchExceptionif iterated value is not a document

Definition at line 59 of file iterator.hpp.


The documentation for this class was generated from the following file: