firebase::database::ValueListener

This is an abstract class.

#include <listener.h>

Value listener interface.

Summary

Subclasses of this listener class can be used to receive events about data changes at a location. Attach the listener to a location using DatabaseReference::AddValueListener() or Query::AddValueListener(), and OnValueChanged() will be called once immediately, and again when the value changes.

Constructors and Destructors

~ValueListener()

Public functions

OnCancelled(const Error & error, const char *error_message)=0
virtual void
This method will be triggered in the event that this listener either failed at the server, or is removed as a result of the security and Firebase rules.
OnValueChanged(const DataSnapshot & snapshot)=0
virtual void
This method will be called with a snapshot of the data at this location each time that data changes.

Public functions

OnCancelled

virtual void OnCancelled(
  const Error & error,
  const char *error_message
)=0

This method will be triggered in the event that this listener either failed at the server, or is removed as a result of the security and Firebase rules.

Details
Parameters
error
A code corresponding to the error that occurred.
error_message
A description of the error that occurred.

OnValueChanged

virtual void OnValueChanged(
  const DataSnapshot & snapshot
)=0

This method will be called with a snapshot of the data at this location each time that data changes.

Details
Parameters
snapshot
The current data at the location.

~ValueListener

virtual  ~ValueListener()