firebase:: firestore:: SnapshotMetadata
#include <snapshot_metadata.h>
Metadata about a snapshot, describing the state of the snapshot.
Summary
Constructors and Destructors | |
|---|---|
SnapshotMetadata()Constructs aSnapshotMetadata that has all of its boolean members set to false. | |
SnapshotMetadata(bool has_pending_writes, bool is_from_cache)Constructs aSnapshotMetadata by providing boolean parameters that describe the state of the snapshot. | |
SnapshotMetadata(constSnapshotMetadata & other)Copy constructor. | |
SnapshotMetadata(SnapshotMetadata && other)Move constructor, equivalent to copying. |
Public functions | |
|---|---|
ToString() const | std::stringReturns a string representation of this SnapshotMetadata for logging/debugging purposes. |
has_pending_writes() const | boolReturns whether the snapshot contains the result of local writes. |
is_from_cache() const | boolReturns whether the snapshot was created from cached data. |
operator=(constSnapshotMetadata & other)=default | Copy assignment operator. |
operator=(SnapshotMetadata && other)=default | Move assignment operator, equivalent to copying. |
Friend classes | |
|---|---|
operator<< | friend std::ostream &Outputs the string representation of this SnapshotMetadata to the given stream. |
Public functions
SnapshotMetadata
SnapshotMetadata()=default
Constructs aSnapshotMetadata that has all of its boolean members set to false.
SnapshotMetadata
SnapshotMetadata(boolhas_pending_writes,boolis_from_cache)
Constructs aSnapshotMetadata by providing boolean parameters that describe the state of the snapshot.
| Details | |||||
|---|---|---|---|---|---|
| Parameters |
|
SnapshotMetadata
SnapshotMetadata(constSnapshotMetadata&other)=default
Copy constructor.
This performs a deep copy, creating an independent instance.
| Details | |||
|---|---|---|---|
| Parameters |
|
SnapshotMetadata
SnapshotMetadata(SnapshotMetadata&&other)=default
Move constructor, equivalent to copying.
After being moved from,SnapshotMetadata is in a valid but unspecified state.
| Details | |||
|---|---|---|---|
| Parameters |
|
ToString
std::stringToString()const
Returns a string representation of thisSnapshotMetadata for logging/debugging purposes.
has_pending_writes
boolhas_pending_writes()const
Returns whether the snapshot contains the result of local writes.
| Details | |
|---|---|
| Returns | true if the snapshot contains the result of local writes (for example, Set() or Update() calls) that have not yet been committed to the backend. If your listener has opted into metadata updates (viaMetadataChanges::kInclude) you will receive another snapshot withhas_pending_writes() equal to false once the writes have been committed to the backend. |
is_from_cache
boolis_from_cache()const
Returns whether the snapshot was created from cached data.
| Details | |
|---|---|
| Returns | true if the snapshot was created from cached data rather than guaranteed up-to-date server data. If your listener has opted into metadata updates (viaMetadataChanges::kInclude) you will receive another snapshot withis_from_cache() equal to false once the client has received up-to-date data from the backend. |
operator=
SnapshotMetadata&operator=(constSnapshotMetadata&other)=default
Copy assignment operator.
This performs a deep copy, creating an independent instance.
| Details | |||
|---|---|---|---|
| Parameters |
| ||
| Returns | Reference to the destination SnapshotMetadata. |
operator=
SnapshotMetadata&operator=(SnapshotMetadata&&other)=default
Move assignment operator, equivalent to copying.
After being moved from,SnapshotMetadata is in a valid but unspecified state.
| Details | |||
|---|---|---|---|
| Parameters |
| ||
| Returns | Reference to the destination SnapshotMetadata. |
Friend classes
operator<<
friendstd::ostream&operator<<(std::ostream&out,constSnapshotMetadata&metadata)
Outputs the string representation of thisSnapshotMetadata 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.