001/*----------------------------------------------------------------------------*/
002/* Copyright (c) FIRST 2017-2018. All Rights Reserved.                        */
003/* Open Source Software - may be modified and shared by FRC teams. The code   */
004/* must be accompanied by the FIRST BSD license file in the root directory of */
005/* the project.                                                               */
006/*----------------------------------------------------------------------------*/
007
008package edu.wpi.first.networktables;
009
010/**
011 * Flag values for use with entry listeners.
012 *
013 * The flags are a bitmask and must be OR'ed together to indicate the
014 * combination of events desired to be received.
015 *
016 * The constants kNew, kDelete, kUpdate, and kFlags represent different events
017 * that can occur to entries.
018 *
019 * By default, notifications are only generated for remote changes occurring
020 * after the listener is created.  The constants kImmediate and kLocal are
021 * modifiers that cause notifications to be generated at other times.
022 */
023public interface EntryListenerFlags {
024  /** Initial listener addition.
025   * Set this flag to receive immediate notification of entries matching the
026   * flag criteria (generally only useful when combined with kNew).
027   */
028  public static final int kImmediate = 0x01;
029
030  /** Changed locally.
031   * Set this flag to receive notification of both local changes and changes
032   * coming from remote nodes.  By default, notifications are only generated
033   * for remote changes.  Must be combined with some combination of kNew,
034   * kDelete, kUpdate, and kFlags to receive notifications of those respective
035   * events.
036   */
037  public static final int kLocal = 0x02;
038
039  /** Newly created entry.
040   * Set this flag to receive a notification when an entry is created.
041   */
042  public static final int kNew = 0x04;
043
044  /** Entry was deleted.
045   * Set this flag to receive a notification when an entry is deleted.
046   */
047  public static final int kDelete = 0x08;
048
049  /** Entry's value changed.
050   * Set this flag to receive a notification when an entry's value (or type)
051   * changes.
052   */
053  public static final int kUpdate = 0x10;
054
055  /** Entry's flags changed.
056   * Set this flag to receive a notification when an entry's flags value
057   * changes.
058   */
059  public static final int kFlags = 0x20;
060}