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::string
Returns a string representation of thisSnapshotMetadata for logging/debugging purposes.
has_pending_writes() const
bool
Returns whether the snapshot contains the result of local writes.
is_from_cache() const
bool
Returns 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 thisSnapshotMetadata 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
has_pending_writes
Whether there is any pending write on the snapshot.
is_from_cache
Whether the snapshot is from cache instead of backend.

SnapshotMetadata

SnapshotMetadata(constSnapshotMetadata&other)=default

SnapshotMetadata

SnapshotMetadata(SnapshotMetadata&&other)=default

Move constructor, equivalent to copying.

After being moved from,SnapshotMetadata is in a valid but unspecified state.

Details
Parameters
other
SnapshotMetadata to move data from.

ToString

std::stringToString()const

operator=

SnapshotMetadata&operator=(constSnapshotMetadata&other)=default

Copy assignment operator.

This performs a deep copy, creating an independent instance.

Note: This class is currently trivially copyable, but it is not guaranteed to stay that way, and code relying on this might be broken by a future release.

Details
Parameters
other
SnapshotMetadata to copy from.
Returns
Reference to the destinationSnapshotMetadata.

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
other
SnapshotMetadata to move data from.
Returns
Reference to the destinationSnapshotMetadata.

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.