View on GitHub
jbson
C++11/1y BSON library
Public Types | Public Member Functions | List of all members
jbson::detail::document_iter< Value, BaseIterator > Struct Template Reference

Forward traversal iterator type for traversing basic_document and basic_array. More...

#include <document.hpp>

+ Inheritance diagram for jbson::detail::document_iter< Value, BaseIterator >:

Public Types

using element_type = Value
 Alias to Value.
 

Public Member Functions

 document_iter ()=default
 Default constructor. Results in an invalid iterator.
 
 document_iter (BaseIterator it1, BaseIterator it2)
 Construct document_iter from pair of BaseIterators. More...
 
template<class OtherValue , typename OtherIt >
 document_iter (const document_iter< OtherValue, OtherIt > &other, std::enable_if_t< std::is_convertible< OtherValue, element_type >::value &&std::is_convertible< OtherIt, BaseIterator >::value > *=nullptr)
 Copy constructor. More...
 
element_typedereference () const
 Dereferences currently held basic_element. More...
 
template<typename OtherValue , typename OtherIterator >
bool equal (const document_iter< OtherValue, OtherIterator > &other) const
 
void increment ()
 

Detailed Description

template<typename Value, typename BaseIterator>
struct jbson::detail::document_iter< Value, BaseIterator >

Forward traversal iterator type for traversing basic_document and basic_array.

The current basic_element is constructed and cached on increment() or document_iter construction. This is required for iteration as the basic_element's size is not known in advance.

Definition at line 45 of file document.hpp.

Constructor & Destructor Documentation

template<typename Value, typename BaseIterator>
jbson::detail::document_iter< Value, BaseIterator >::document_iter ( BaseIterator  it1,
BaseIterator  it2 
)
inline

Construct document_iter from pair of BaseIterators.

Parameters
it1iterator to first item of data.
it2iterator past the end of data.

Definition at line 60 of file document.hpp.

template<typename Value, typename BaseIterator>
template<class OtherValue , typename OtherIt >
jbson::detail::document_iter< Value, BaseIterator >::document_iter ( const document_iter< OtherValue, OtherIt > &  other,
std::enable_if_t< std::is_convertible< OtherValue, element_type >::value &&std::is_convertible< OtherIt, BaseIterator >::value > *  = nullptr 
)
inline

Copy constructor.

Enables construction from document_iter with different, but compatible type signature.

Definition at line 72 of file document.hpp.

Member Function Documentation

template<typename Value, typename BaseIterator>
element_type& jbson::detail::document_iter< Value, BaseIterator >::dereference ( ) const
inline

Dereferences currently held basic_element.

Returns
Reference to cached basic_element.

Asserts that currently cached element is valid in debug mode.

Definition at line 112 of file document.hpp.


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