13 #include "support/atomic_static.h"
14 #include "support/SafeThread.h"
15 #include "ntcore_cpp.h"
20 friend class NotifierTest;
32 bool local_notifiers()
const {
return m_local_notifiers; }
33 static bool destroyed() {
return s_destroyed; }
35 void SetOnStart(std::function<
void()> on_start) { m_on_start = on_start; }
36 void SetOnExit(std::function<
void()> on_exit) { m_on_exit = on_exit; }
38 unsigned int AddEntryListener(llvm::StringRef prefix,
39 EntryListenerCallback callback,
41 void RemoveEntryListener(
unsigned int entry_listener_uid);
43 void NotifyEntry(StringRef name, std::shared_ptr<Value> value,
44 unsigned int flags, EntryListenerCallback only =
nullptr);
46 unsigned int AddConnectionListener(ConnectionListenerCallback callback);
47 void RemoveConnectionListener(
unsigned int conn_listener_uid);
49 void NotifyConnection(
bool connected,
const ConnectionInfo& conn_info,
50 ConnectionListenerCallback only =
nullptr);
56 wpi::SafeThreadOwner<Thread> m_owner;
58 std::atomic_bool m_local_notifiers;
60 std::function<void()> m_on_start;
61 std::function<void()> m_on_exit;
64 static bool s_destroyed;
69 #endif // NT_NOTIFIER_H_
NetworkTables Connection Information.
Definition: ntcore_cpp.h:43
Definition: Notifier.h:19
Definition: Notifier.cpp:63