firebase:: firestore:: Settings
#include <settings.h>
Settings used to configure aFirestore instance.
Summary
Constructors and Destructors | |
|---|---|
Settings()Creates the default settings. | |
Settings(constSettings & other)Copy constructor. | |
Settings(Settings && other)Move constructor. |
Public static attributes | |
|---|---|
kCacheSizeUnlimited = -1 | constexpr int64_tConstant to use with set_cache_size_bytes to disable garbage collection. |
Friend classes | |
|---|---|
operator<< | friend std::ostream &Outputs the string representation of these Settings to the given stream. |
Public functions | |
|---|---|
ToString() const | std::stringReturns a string representation of these Settings for logging/debugging purposes. |
cache_size_bytes() const | int64_tReturns cache size for on-disk data. |
dispatch_queue() const | dispatch_queue_tReturns a dispatch queue thatFirestore will use to execute callbacks. |
host() const | const std::string &Gets the host of theFirestore backend to connect to. |
is_persistence_enabled() const | boolReturns whether to enable local persistent storage. |
is_ssl_enabled() const | boolReturns whether to use SSL when communicating. |
operator=(constSettings & other)=default | Settings &Copy assignment operator. |
operator=(Settings && other)=default | Settings &Move assignment operator. |
set_cache_size_bytes(int64_t value) | voidSets an approximate cache size threshold for the on-disk data. |
set_dispatch_queue(dispatch_queue_t queue) | voidSets the dispatch queue thatFirestore will use to execute callbacks. |
set_host(std::string host) | voidSets the host of theFirestore backend. |
set_persistence_enabled(bool enabled) | voidEnables or disables local persistent storage. |
set_ssl_enabled(bool enabled) | voidEnables or disables SSL for communication. |
Public static attributes
kCacheSizeUnlimited
constexprint64_tkCacheSizeUnlimited=-1
Constant to use withset_cache_size_bytes to disable garbage collection.
Friend classes
operator<<
friendstd::ostream&operator<<(std::ostream&out,constSettings&settings)
Outputs the string representation of theseSettings to the given stream.
See also:ToString() for comments on the representation format.
Public functions
Settings
Settings()
Creates the default settings.
Settings
Settings(constSettings&other)=default
Copy constructor.
This performs a deep copy, creating an independent instance.
| Details | |||
|---|---|---|---|
| Parameters |
|
Settings
Settings(Settings&&other)=default
ToString
std::stringToString()const
Returns a string representation of theseSettings for logging/debugging purposes.
cache_size_bytes
int64_tcache_size_bytes()const
Returns cache size for on-disk data.
dispatch_queue
dispatch_queue_tdispatch_queue()const
Returns a dispatch queue thatFirestore will use to execute callbacks.
The returned dispatch queue is used for all completion handlers and event handlers.
If no dispatch queue is explictly set by callingset_dispatch_queue() then a dedicated "callback queue" will be used; namely, the main thread will not be used for callbacks unless expliclty set to do so by a call toset_dispatch_queue().
Note: This method is only available when__OBJC__ is defined, such as when compiling for iOS or tvOS.See also:set_dispatch_queue(dispatch_queue_t) for information on how to explicitly set the dispatch queue to use.
is_persistence_enabled
boolis_persistence_enabled()const
Returns whether to enable local persistent storage.
is_ssl_enabled
boolis_ssl_enabled()const
Returns whether to use SSL when communicating.
set_cache_size_bytes
voidset_cache_size_bytes(int64_tvalue)
Sets an approximate cache size threshold for the on-disk data.
If the cache grows beyond this size, CloudFirestore will start removing data that hasn't been recently used. The size is not a guarantee that the cache will stay below that size, only that if the cache exceeds the given size, cleanup will be attempted.
By default, collection is enabled with a cache size of 100 MB. The minimum value is 1 MB.
set_dispatch_queue
voidset_dispatch_queue(dispatch_queue_tqueue)
Sets the dispatch queue thatFirestore will use to execute callbacks.
The specified dispatch queue will be used for all completion handlers and event handlers.
Note: This method is only available when__OBJC__ is defined, such as when compiling for iOS or tvOS.See also:dispatch_queue() for the "get" counterpart to this method.
| Details | |||
|---|---|---|---|
| Parameters |
|
set_host
voidset_host(std::stringhost)
Sets the host of theFirestore backend.
The default is "firestore.googleapis.com".
| Details | |||
|---|---|---|---|
| Parameters |
|
set_persistence_enabled
voidset_persistence_enabled(boolenabled)
Enables or disables local persistent storage.
| Details | |||
|---|---|---|---|
| Parameters |
|
set_ssl_enabled
voidset_ssl_enabled(boolenabled)
Enables or disables SSL for communication.
| Details | |||
|---|---|---|---|
| Parameters |
|
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.