isSnapshot method

bool isSnapshot()

Inquiry method that asks whether the current update belongs to the item snapshot (which carries the current item state at the time of Subscription).

Snapshot events are sent only if snapshot information was requested for the items through Subscription.setRequestedSnapshot and precede the real time events. Snapshot information take different forms in different subscription modes and can be spanned across zero, one or several update events. In particular:

  • if the item is subscribed to with the RAW subscription mode, then no snapshot is sent by the Server;
  • if the item is subscribed to with the MERGE subscription mode, then the snapshot consists of exactly one event, carrying the current value for all fields;
  • if the item is subscribed to with the DISTINCT subscription mode, then the snapshot consists of some of the most recent updates; these updates are as many as specified through [Subscription#setRequestedSnapshot], unless fewer are available;
  • if the item is subscribed to with the COMMAND subscription mode, then the snapshot consists of an "ADD" event for each key that is currently present.
Note that, in case of two-level behavior, snapshot-related updates for both the first-level item (which is in COMMAND mode) and any second-level items (which are in MERGE mode) are qualified with this flag.

Returns true if the current update event belongs to the item snapshot; false otherwise.

Implementation

bool isSnapshot() {
  return _isSnapshot;
}