firebase:: firestore:: TransactionOptions
#include <transaction_options.h>
Options to customize transaction behavior forFirestore.runTransaction().
Summary
Constructors and Destructors | |
|---|---|
TransactionOptions()Creates the default TransactionOptions. | |
TransactionOptions(constTransactionOptions & other)Copy constructor. | |
TransactionOptions(TransactionOptions && other)Move constructor. |
Public functions | |
|---|---|
ToString() const | std::stringReturns a string representation of this TransactionOptions object for logging/debugging purposes. |
max_attempts() const | int32_tGets the maximum number of attempts to commit, after which the transaction fails. |
operator=(constTransactionOptions & other)=default | Copy assignment operator. |
operator=(TransactionOptions && other)=default | Move assignment operator. |
set_max_attempts(int32_t max_attempts) | voidSets the maximum number of attempts to commit, after which the transaction fails. |
Friend classes | |
|---|---|
operator<< | friend std::ostream &Outputs the string representation of this TransactionOptions object to the given stream. |
Public functions
ToString
std::stringToString()const
Returns a string representation of thisTransactionOptions object for logging/debugging purposes.
TransactionOptions
TransactionOptions(constTransactionOptions&other)=default
Copy constructor.
This performs a deep copy, creating an independent instance.
| Details | |||
|---|---|---|---|
| Parameters |
|
TransactionOptions
TransactionOptions(TransactionOptions&&other)=default
Move constructor.
Moving is not any more efficient than copying forTransactionOptions because this class is trivially copyable; however, future additions to this class may make it not trivially copyable, at which point moving would be more efficient than copying. After being moved from,TransactionOptions is in a valid but unspecified state.
| Details | |||
|---|---|---|---|
| Parameters |
|
max_attempts
int32_tmax_attempts()const
Gets the maximum number of attempts to commit, after which the transaction fails.
The default value is 5.
operator=
TransactionOptions&operator=(constTransactionOptions&other)=default
Copy assignment operator.
This performs a deep copy, creating an independent instance.
| Details | |||
|---|---|---|---|
| Parameters |
| ||
| Returns | Reference to the destination TransactionOptions. |
operator=
TransactionOptions&operator=(TransactionOptions&&other)=default
Move assignment operator.
Moving is not any more efficient than copying forTransactionOptions because this class is trivially copyable; however, future additions to this class may make it not trivially copyable, at which point moving would be more efficient than copying. After being moved from,TransactionOptions is in a valid but unspecified state.
| Details | |||
|---|---|---|---|
| Parameters |
| ||
| Returns | Reference to the destination TransactionOptions. |
set_max_attempts
voidset_max_attempts(int32_tmax_attempts)
Sets the maximum number of attempts to commit, after which the transaction fails.
The default value is 5.
| Details | |||
|---|---|---|---|
| Parameters |
|
Friend classes
operator<<
friendstd::ostream&operator<<(std::ostream&,constTransactionOptions&)
Outputs the string representation of thisTransactionOptions object to the given stream.
See also:ToString() for comments on the representation format.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-01-23 UTC.