WPILibC++  unspecified
IEntryNotifier.h
1 /*----------------------------------------------------------------------------*/
2 /* Copyright (c) FIRST 2017-2018. 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  llvm::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,
33  llvm::StringRef prefix,
34  unsigned int flags) = 0;
35  virtual unsigned int AddPolled(unsigned int poller_uid, unsigned int local_id,
36  unsigned int flags) = 0;
37 
38  virtual void NotifyEntry(unsigned int local_id, StringRef name,
39  std::shared_ptr<Value> value, unsigned int flags,
40  unsigned int only_listener = UINT_MAX) = 0;
41 };
42 
43 } // namespace nt
44 
45 #endif // NTCORE_IENTRYNOTIFIER_H_
NetworkTables Entry Notification.
Definition: ntcore_cpp.h:169
Definition: IEntryNotifier.h:16
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:42
Definition: IEntryNotifier.h:18