MongoDB C++ Driver  mongocxx-3.10.2
Public Member Functions | List of all members
mongocxx::v_noabi::options::transaction Class Reference

Class representing the optional arguments for a transaction. More...

#include <transaction.hpp>

Public Member Functions

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

Detailed Description

Class representing the optional arguments for a transaction.

Member Function Documentation

◆ max_commit_time_ms() [1/2]

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.

◆ read_concern() [1/2]

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]

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]

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: