firebase:: database:: MutableData
#include <mutable_data.h>
Instances of this class encapsulate the data and priority at a location.
Summary
It is used in transactions, and it is intended to be inspected and then updated to the desired data at that location.
Constructors and Destructors | |
|---|---|
~MutableData()Destructor. |
Public functions | |
|---|---|
Child(const char *path) | Used to obtain aMutableData instance that encapsulates the data and priority at the given relative path. |
Child(const std::string & path) | Used to obtain aMutableData instance that encapsulates the data and priority at the given relative path. |
HasChild(const char *path) const | boolDoes thisMutableData have data at a particular location? |
HasChild(const std::string & path) const | boolDoes thisMutableData have data at a particular location? |
children() | std::vector<MutableData >Get all the immediate children of this location. |
children_count() | size_tGet the number of children of this location. |
key() const | const char *Get the key name of the source location of this data. |
key_string() const | std::stringGet the key name of the source location of this data. |
priority() | Get the priority of the data contained at this snapshot. |
set_priority(constVariant & priority) | voidSets the priority of this field, which controls its sort order relative to its siblings. |
set_value(constVariant & value) | voidSets the data at this location to the given value. |
value() const | Get the value of the data contained at this location. |
Public functions
Child
MutableDataChild(constchar*path)
Used to obtain aMutableData instance that encapsulates the data and priority at the given relative path.
Note that changes made to a childMutableData instance will be visible to the parent and vice versa.
| Details | |||
|---|---|---|---|
| Parameters |
| ||
| Returns | MutableData for the Child relative to this location. The memory will be freed when the Transaction is finished. |
Child
MutableDataChild(conststd::string&path)
Used to obtain aMutableData instance that encapsulates the data and priority at the given relative path.
| Details | |||
|---|---|---|---|
| Parameters |
| ||
| Returns | MutableData for the Child relative to this location. The memory will be freed when the Transaction is finished. |
HasChild
boolHasChild(constchar*path)const
Does thisMutableData have data at a particular location?
| Details | |||
|---|---|---|---|
| Parameters |
| ||
| Returns | True if there is data at the specified location, false if not. |
HasChild
boolHasChild(conststd::string&path)const
Does thisMutableData have data at a particular location?
| Details | |||
|---|---|---|---|
| Parameters |
| ||
| Returns | True if there is data at the specified location, false if not. |
children
std::vector<MutableData>children()
Get all the immediate children of this location.
| Details | |
|---|---|
| Returns | The immediate children of this location. |
children_count
size_tchildren_count()
Get the number of children of this location.
| Details | |
|---|---|
| Returns | The number of immediate children of this location. |
key
constchar*key()const
Get the key name of the source location of this data.
Note: The returned pointer is only guaranteed to be valid during the transaction.
| Details | |
|---|---|
| Returns | Key name of the source location of this data. |
key_string
std::stringkey_string()const
Get the key name of the source location of this data.
| Details | |
|---|---|
| Returns | Key name of the source location of this data. |
priority
Variantpriority()
Get the priority of the data contained at this snapshot.
| Details | |
|---|---|
| Returns | The value of this location's Priority relative to its siblings. |
set_priority
voidset_priority(constVariant&priority)
Sets the priority of this field, which controls its sort order relative to its siblings.
See also:firebase::database::DatabaseReference::SetPriority() for information on how Priority affects the ordering of a node'schildren.
| Details | |||
|---|---|---|---|
| Parameters |
|
set_value
voidset_value(constVariant&value)
Sets the data at this location to the given value.
| Details | |||
|---|---|---|---|
| Parameters |
|
value
Variantvalue()const
Get the value of the data contained at this location.
| Details | |
|---|---|
| Returns | The value of the data contained at this location. |
~MutableData
~MutableData()
Destructor.
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.