firebase::firestore::ListenerRegistration

#include <listener_registration.h>

Represents a listener that can be removed by calling Remove().

Summary

Constructors and Destructors

ListenerRegistration()
Creates an invalid ListenerRegistration that has to be reassigned before it can be used.
ListenerRegistration(const ListenerRegistration & other)
Copy constructor.
ListenerRegistration(ListenerRegistration && other)
Move constructor.
~ListenerRegistration()

Public functions

Remove()
virtual void
Removes the listener being tracked by this ListenerRegistration.
is_valid() const
bool
Returns true if this ListenerRegistration is valid, false if it is not valid.
operator=(const ListenerRegistration & other)
Copy assignment operator.
operator=(ListenerRegistration && other)
Move assignment operator.

Public functions

ListenerRegistration

 ListenerRegistration()

Creates an invalid ListenerRegistration that has to be reassigned before it can be used.

Calling Remove() on an invalid ListenerRegistration is a no-op.

ListenerRegistration

 ListenerRegistration(
  const ListenerRegistration & 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 a ListenerRegistration, after calling Remove on one of them, the listener is removed, and calling Remove 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 a ListenerRegistration. After being moved from, a ListenerRegistration is equivalent to its default-constructed state.

Details
Parameters
other
ListenerRegistration to move data from.

Remove

virtual void Remove()

Removes the listener being tracked by this ListenerRegistration.

After the initial call, subsequent calls have no effect.

is_valid

bool is_valid() const 

Returns true if this ListenerRegistration is valid, false if it is not valid.

An invalid ListenerRegistration could be the result of:

Details
Returns
true if this ListenerRegistration is valid, false if this ListenerRegistration is invalid.

operator=

ListenerRegistration & operator=(
  const ListenerRegistration & 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 a ListenerRegistration, after calling Remove on one of them, the listener is removed, and calling Remove on any other copies will be a no-op.

Details
Parameters
other
ListenerRegistration to copy from.
Returns
Reference to the destination ListenerRegistration.

operator=

ListenerRegistration & operator=(
  ListenerRegistration && other
)

Move assignment operator.

Moving is more efficient than copying for a ListenerRegistration. After being moved from, a ListenerRegistration is equivalent to its default-constructed state.

Details
Parameters
other
ListenerRegistration to move data from.
Returns
Reference to the destination ListenerRegistration.

~ListenerRegistration

virtual  ~ListenerRegistration()