firebase:: firestore:: TransactionOptions
#include <transaction_options.h>
Options to customize transaction behavior for Firestore.runTransaction().
Summary
Constructors and Destructors |
|
|---|---|
TransactionOptions()
Creates the default
TransactionOptions. |
|
TransactionOptions(const TransactionOptions & other)
Copy constructor.
|
|
TransactionOptions(TransactionOptions && other)
Move constructor.
|
Public functions |
|
|---|---|
ToString() const
|
std::string
Returns a string representation of this
TransactionOptions object for logging/debugging purposes. |
max_attempts() const
|
int32_t
Gets the maximum number of attempts to commit, after which the transaction fails.
|
operator=(const TransactionOptions & other)=default
|
Copy assignment operator.
|
operator=(TransactionOptions && other)=default
|
Move assignment operator.
|
set_max_attempts(int32_t max_attempts)
|
void
Sets 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::string ToString() const
Returns a string representation of this TransactionOptions object for logging/debugging purposes.
TransactionOptions
TransactionOptions( const TransactionOptions & 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 for TransactionOptions 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_t max_attempts() const
Gets the maximum number of attempts to commit, after which the transaction fails.
The default value is 5.
operator=
TransactionOptions & operator=( const TransactionOptions & 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 for TransactionOptions 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
void set_max_attempts( int32_t max_attempts )
Sets the maximum number of attempts to commit, after which the transaction fails.
The default value is 5.
| Details | |||
|---|---|---|---|
| Parameters |
|
Friend classes
operator<<
friend std::ostream & operator<<(std::ostream &, const TransactionOptions &)
Outputs the string representation of this TransactionOptions object to the given stream.
See also:ToString() for comments on the representation format.