WPILibC++  unspecified
IEntryNotifier.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_IENTRYNOTIFIER_H_
9 #define NTCORE_IENTRYNOTIFIER_H_
10 
11 #include <climits>
12 #include <memory>
13 
14 #include "ntcore_cpp.h"
15 
16 namespace nt {
17 
19  public:
20  IEntryNotifier() = default;
21  IEntryNotifier(const IEntryNotifier&) = delete;
22  IEntryNotifier& operator=(const IEntryNotifier&) = delete;
23  virtual ~IEntryNotifier() = default;
24  virtual bool local_notifiers() const = 0;
25 
26  virtual unsigned int Add(
27  std::function<void(const EntryNotification& event)> callback,
28  wpi::StringRef prefix, unsigned int flags) = 0;
29  virtual unsigned int Add(
30  std::function<void(const EntryNotification& event)> callback,
31  unsigned int local_id, unsigned int flags) = 0;
32  virtual unsigned int AddPolled(unsigned int poller_uid, wpi::StringRef prefix,
33  unsigned int flags) = 0;
34  virtual unsigned int AddPolled(unsigned int poller_uid, unsigned int local_id,
35  unsigned int flags) = 0;
36 
37  virtual void NotifyEntry(unsigned int local_id, StringRef name,
38  std::shared_ptr<Value> value, unsigned int flags,
39  unsigned int only_listener = UINT_MAX) = 0;
40 };
41 
42 } // namespace nt
43 
44 #endif // NTCORE_IENTRYNOTIFIER_H_
NetworkTables Entry Notification.
Definition: ntcore_cpp.h:171
Definition: IStorage.h:21
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:49
Definition: IEntryNotifier.h:18