WPILibC++  2019.1.1-beta-1-17-ge27d6d7
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
ITableListener.h
1 /*----------------------------------------------------------------------------*/
2 /* Copyright (c) 2017-2018 FIRST. All Rights Reserved. */
3 /* Open Source Software - may be modified and shared by FRC teams. The code */
4 /* must be accompanied by the FIRST BSD license file in the root directory of */
5 /* the project. */
6 /*----------------------------------------------------------------------------*/
7 
8 #ifndef NTCORE_TABLES_ITABLELISTENER_H_
9 #define NTCORE_TABLES_ITABLELISTENER_H_
10 
11 #include <memory>
12 
13 #include <wpi/StringRef.h>
14 #include <wpi/deprecated.h>
15 
16 #include "networktables/NetworkTableValue.h"
17 
18 #ifdef __GNUC__
19 #pragma GCC diagnostic push
20 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
21 #endif
22 
23 class ITable;
24 
28 class WPI_DEPRECATED(
29  "Use EntryListener, TableEntryListener, or TableListener as appropriate")
30  ITableListener {
31  public:
32  virtual ~ITableListener() = default;
41  virtual void ValueChanged(ITable* source, wpi::StringRef key,
42  std::shared_ptr<nt::Value> value, bool isNew) = 0;
43 
54  virtual void ValueChangedEx(ITable* source, wpi::StringRef key,
55  std::shared_ptr<nt::Value> value,
56  unsigned int flags);
57 };
58 
59 #ifdef __GNUC__
60 #pragma GCC diagnostic pop
61 #endif
62 
63 #endif // NTCORE_TABLES_ITABLELISTENER_H_
std::function< void(NetworkTable *table, StringRef name, NetworkTableEntry entry, std::shared_ptr< Value > value, int flags)> TableEntryListener
A listener that listens to changes in values in a NetworkTable.
Definition: TableEntryListener.h:41
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:49
std::function< void(NetworkTable *parent, StringRef name, NetworkTable *table)> TableListener
A listener that listens to new sub-tables in a NetworkTable.
Definition: TableListener.h:35