WPILibC++  2020.3.2
ITableListener.h
1 /*----------------------------------------------------------------------------*/
2 /* Copyright (c) 2017-2019 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 #elif _WIN32
22 #pragma warning(push)
23 #pragma warning(disable : 4996)
24 #endif
25 
26 class ITable;
27 
31 class WPI_DEPRECATED(
32  "Use EntryListener, TableEntryListener, or TableListener as appropriate")
33  ITableListener {
34  public:
35  virtual ~ITableListener() = default;
44  virtual void ValueChanged(ITable* source, wpi::StringRef key,
45  std::shared_ptr<nt::Value> value, bool isNew) = 0;
46 
57  virtual void ValueChangedEx(ITable* source, wpi::StringRef key,
58  std::shared_ptr<nt::Value> value,
59  unsigned int flags);
60 };
61 
62 #ifdef __GNUC__
63 #pragma GCC diagnostic pop
64 #elif _WIN32
65 #pragma warning(pop)
66 #endif
67 
68 #endif // NTCORE_TABLES_ITABLELISTENER_H_
nt::TableListener
std::function< void(NetworkTable *parent, StringRef name, std::shared_ptr< NetworkTable > table)> TableListener
A listener that listens to new sub-tables in a NetworkTable.
Definition: TableListener.h:35
nt::TableEntryListener
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
wpi::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:49