MongoDB C++ Driver mongocxx-4.0.0
Loading...
Searching...
No Matches
mongocxx::v_noabi::options::transaction Class Reference

#include <mongocxx/v_noabi/mongocxx/options/transaction.hpp>

Description

Class representing the optional arguments for a transaction.

Public Member Functions

 transaction (const transaction &)
 Copy constructs transaction options.
 
 transaction (transaction &&) noexcept
 Move constructs transaction options.
 
 ~transaction () noexcept
 Destroys the transaction options.
 
bsoncxx::v_noabi::stdx::optional< std::chrono::milliseconds > max_commit_time_ms () const
 Gets the current transaction commit time, in milliseconds.
 
transactionmax_commit_time_ms (std::chrono::milliseconds ms)
 Sets the transaction's max commit time, in milliseconds.
 
transactionoperator= (const transaction &)
 Copy assigns transaction options.
 
transactionoperator= (transaction &&) noexcept
 Move assigns transaction options.
 
bsoncxx::v_noabi::stdx::optional< mongocxx::v_noabi::read_concernread_concern () const
 Gets the current transaction read concern.
 
transactionread_concern (const mongocxx::v_noabi::read_concern &rc)
 Sets the transaction read concern.
 
bsoncxx::v_noabi::stdx::optional< mongocxx::v_noabi::read_preferenceread_preference () const
 Gets the current transaction read preference.
 
transactionread_preference (const mongocxx::v_noabi::read_preference &rp)
 Sets the transaction read preference.
 
bsoncxx::v_noabi::stdx::optional< mongocxx::v_noabi::write_concernwrite_concern () const
 Gets the current transaction write concern.
 
transactionwrite_concern (const mongocxx::v_noabi::write_concern &wc)
 Sets the transaction write concern.
 

Constructor & Destructor Documentation

◆ transaction() [1/2]

mongocxx::v_noabi::options::transaction::transaction ( const transaction & )

Copy constructs transaction options.

◆ transaction() [2/2]

mongocxx::v_noabi::options::transaction::transaction ( transaction && )
noexcept

Move constructs transaction options.

◆ ~transaction()

mongocxx::v_noabi::options::transaction::~transaction ( )
noexcept

Destroys the transaction options.

Member Function Documentation

◆ max_commit_time_ms() [1/2]

bsoncxx::v_noabi::stdx::optional< std::chrono::milliseconds > mongocxx::v_noabi::options::transaction::max_commit_time_ms ( ) const

Gets the current transaction commit time, in milliseconds.

Returns
An optional containing the timeout. If the max commit time has not been set, a disengaged optional is returned.

◆ max_commit_time_ms() [2/2]

transaction & mongocxx::v_noabi::options::transaction::max_commit_time_ms ( std::chrono::milliseconds ms)

Sets the transaction's max commit time, in milliseconds.

Parameters
msThe max commit time in milliseconds.
Returns
A reference to the object on which this function is being called.

◆ operator=() [1/2]

transaction & mongocxx::v_noabi::options::transaction::operator= ( const transaction & )

Copy assigns transaction options.

◆ operator=() [2/2]

transaction & mongocxx::v_noabi::options::transaction::operator= ( transaction && )
noexcept

Move assigns transaction options.

◆ read_concern() [1/2]

bsoncxx::v_noabi::stdx::optional< mongocxx::v_noabi::read_concern > mongocxx::v_noabi::options::transaction::read_concern ( ) const

Gets the current transaction read concern.

Returns
An optional containing the read concern. If the read concern has not been set, a disengaged optional is returned.

◆ read_concern() [2/2]

transaction & mongocxx::v_noabi::options::transaction::read_concern ( const mongocxx::v_noabi::read_concern & rc)

Sets the transaction read concern.

Parameters
rcThe read concern.
Returns
A reference to the object on which this member function is being called. This facilitates method chaining.

◆ read_preference() [1/2]

bsoncxx::v_noabi::stdx::optional< mongocxx::v_noabi::read_preference > mongocxx::v_noabi::options::transaction::read_preference ( ) const

Gets the current transaction read preference.

Returns
An optional containing the read preference. If the read preference has not been set, a disengaged optional is returned.

◆ read_preference() [2/2]

transaction & mongocxx::v_noabi::options::transaction::read_preference ( const mongocxx::v_noabi::read_preference & rp)

Sets the transaction read preference.

Parameters
rpThe read preference.
Returns
A reference to the object on which this member function is being called. This facilitates method chaining.

◆ write_concern() [1/2]

bsoncxx::v_noabi::stdx::optional< mongocxx::v_noabi::write_concern > mongocxx::v_noabi::options::transaction::write_concern ( ) const

Gets the current transaction write concern.

Returns
The write concern.
An optional containing the write concern. If the write concern has not been set, a disengaged optional is returned.

◆ write_concern() [2/2]

transaction & mongocxx::v_noabi::options::transaction::write_concern ( const mongocxx::v_noabi::write_concern & wc)

Sets the transaction write concern.

Parameters
wcThe write concern.
Returns
A reference to the object on which this member function is being called. This facilitates method chaining.

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