MongoDB C++ Driver mongocxx-3.11.0
Loading...
Searching...
No Matches
mongocxx::v_noabi::change_stream::iterator Class Reference

#include <mongocxx/v_noabi/mongocxx/change_stream.hpp>

Description

Class representing a MongoDB change stream iterator.

Public Member Functions

 iterator ()
 Default-construct an iterator. Default-constucted iterators can be compared (all default-constructed iterators are ==), assigned, and copied.
 
const bsoncxx::v_noabi::document::viewoperator* () const
 Dereferences the view for the document currently being pointed to.
 
iteratoroperator++ ()
 Pre-increments the iterator to move to the next document.
 
void operator++ (int)
 Post-increments the iterator to move to the next document.
 
const bsoncxx::v_noabi::document::viewoperator-> () const
 Accesses a member of the dereferenced document currently being pointed to.
 

Related Symbols

(Note that these are not member symbols.)

bool operator== (const change_stream::iterator &, const change_stream::iterator &) noexcept
 Compare two iterators for (in)-equality.
 
bool operator!= (const change_stream::iterator &, const change_stream::iterator &) noexcept
 Compare two iterators for (in)-equality.
 

Constructor & Destructor Documentation

◆ iterator()

mongocxx::v_noabi::change_stream::iterator::iterator ( )

Default-construct an iterator. Default-constucted iterators can be compared (all default-constructed iterators are ==), assigned, and copied.

Member Function Documentation

◆ operator*()

const bsoncxx::v_noabi::document::view & mongocxx::v_noabi::change_stream::iterator::operator* ( ) const

Dereferences the view for the document currently being pointed to.

The returned document::view is valid until the iterator is incremented. The value may be copied to extend its lifetime.

◆ operator++() [1/2]

iterator & mongocxx::v_noabi::change_stream::iterator::operator++ ( )

Pre-increments the iterator to move to the next document.

change_stream::begin() and increment operators may block if the current batch of documents is exhausted. They will not return until a notification is available, the max_await_time (from the options::change_stream) milliseconds have elapsed, or a server error is encountered.

If no notification is available, callers may call change_stream::begin() to check for more notifications.

Exceptions
mongocxx::v_noabi::query_exceptionif the query failed

◆ operator++() [2/2]

void mongocxx::v_noabi::change_stream::iterator::operator++ ( int )

Post-increments the iterator to move to the next document.

change_stream::begin() and increment operators may block if the current batch of documents is exhausted. They will not return until a notification is available, the max_await_time (from the options::change_stream) milliseconds have elapsed, or a server error is encountered.

If no notification is available, callers may call change_stream::begin() to check for more notifications.

Exceptions
mongocxx::v_noabi::query_exceptionif the query failed

◆ operator->()

const bsoncxx::v_noabi::document::view * mongocxx::v_noabi::change_stream::iterator::operator-> ( ) const

Accesses a member of the dereferenced document currently being pointed to.

The returned document::view is valid until the iterator is incremented. The value may be copied to extend its lifetime.

Friends And Related Symbol Documentation

◆ operator!=

bool operator!= ( const change_stream::iterator & ,
const change_stream::iterator &  )
friend

Compare two iterators for (in)-equality.

Iterators compare equal if they point to the same underlying change_stream or if both are exhausted.

◆ operator==

bool operator== ( const change_stream::iterator & ,
const change_stream::iterator &  )
friend

Compare two iterators for (in)-equality.

Iterators compare equal if they point to the same underlying change_stream or if both are exhausted.


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