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 void
Removes the listener being tracked by thisListenerRegistration.
is_valid() const
bool
Returns true if thisListenerRegistration 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
other
ListenerRegistration to copy from.

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
other
ListenerRegistration to move data from.

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:

Details
Returns
true if thisListenerRegistration 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
other
ListenerRegistration to copy from.
Returns
Reference to the destinationListenerRegistration.

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

~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.