firebase:: firestore:: ListenerRegistration
#include <listener_registration.h>
Represents a listener that can be removed by callingRemove().
Summary
Constructors and Destructors | |
|---|---|
ListenerRegistration()Creates an invalidListenerRegistration that has to be reassigned before it can be used. | |
ListenerRegistration(constListenerRegistration & other)Copy constructor. | |
ListenerRegistration(ListenerRegistration && other)Move constructor. | |
~ListenerRegistration() |
Public functions | |
|---|---|
Remove() | virtual voidRemoves the listener being tracked by thisListenerRegistration. |
is_valid() const | boolReturns true if this ListenerRegistration is valid, false if it is not valid. |
operator=(constListenerRegistration & other) | Copy assignment operator. |
operator=(ListenerRegistration && other) | Move assignment operator. |
Public functions
ListenerRegistration
ListenerRegistration()
Creates an invalidListenerRegistration that has to be reassigned before it can be used.
CallingRemove() on an invalidListenerRegistration is a no-op.
ListenerRegistration
ListenerRegistration(constListenerRegistration&other)
Copy constructor.
ListenerRegistration can be efficiently copied because it simply refers to the same underlying listener. If there is more than one copy of aListenerRegistration, after callingRemove on one of them, the listener is removed, and callingRemove on any other copies will be a no-op.
| Details | |||
|---|---|---|---|
| Parameters |
|
ListenerRegistration
ListenerRegistration(ListenerRegistration&&other)
Move constructor.
Moving is more efficient than copying for aListenerRegistration. After being moved from, aListenerRegistration is equivalent to its default-constructed state.
| Details | |||
|---|---|---|---|
| Parameters |
|
Remove
virtualvoidRemove()
Removes the listener being tracked by thisListenerRegistration.
After the initial call, subsequent calls have no effect.
is_valid
boolis_valid()const
Returns true if thisListenerRegistration is valid, false if it is not valid.
An invalidListenerRegistration could be the result of:
- Creating a
ListenerRegistrationusing the default constructor. - Moving from the
ListenerRegistration. - Deleting yourFirestore instance, which will invalidate all the
ListenerRegistrationinstances associated with it.
| Details | |
|---|---|
| Returns | true if this ListenerRegistration is valid, false if thisListenerRegistration is invalid. |
operator=
ListenerRegistration&operator=(constListenerRegistration&other)
Copy assignment operator.
ListenerRegistration can be efficiently copied because it simply refers to the same underlying listener. If there is more than one copy of aListenerRegistration, after callingRemove on one of them, the listener is removed, and callingRemove on any other copies will be a no-op.
| Details | |||
|---|---|---|---|
| Parameters |
| ||
| Returns | Reference to the destination ListenerRegistration. |
operator=
ListenerRegistration&operator=(ListenerRegistration&&other)
Move assignment operator.
Moving is more efficient than copying for aListenerRegistration. After being moved from, aListenerRegistration is equivalent to its default-constructed state.
| Details | |||
|---|---|---|---|
| Parameters |
| ||
| Returns | Reference to the destination ListenerRegistration. |
~ListenerRegistration
virtual~ListenerRegistration()
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.