Add missing SubTableListener methods to C++ NetworkTable (#1465)

This commit is contained in:
Thad House
2018-12-06 23:27:49 -08:00
committed by Peter Johnson
parent b64dfacff3
commit 3d546428ab
3 changed files with 39 additions and 3 deletions

View File

@@ -56,6 +56,7 @@ class NetworkTable final : public ITable {
mutable wpi::StringMap<NT_Entry> m_entries;
typedef std::pair<ITableListener*, NT_EntryListener> Listener;
std::vector<Listener> m_listeners;
std::vector<NT_EntryListener> m_lambdaListeners;
static std::vector<std::string> s_ip_addresses;
static std::string s_persistent_filename;
@@ -338,14 +339,14 @@ class NetworkTable final : public ITable {
* @return Listener handle
*/
NT_EntryListener AddSubTableListener(TableListener listener,
bool localNotify = false) const;
bool localNotify = false);
/**
* Remove a sub-table listener.
*
* @param listener listener handle
*/
void RemoveTableListener(NT_EntryListener listener) const;
void RemoveTableListener(NT_EntryListener listener);
WPI_DEPRECATED(
"use AddEntryListener() instead with flags value of NT_NOTIFY_NEW | "

View File

@@ -31,7 +31,7 @@ using wpi::StringRef;
* @ingroup ntcore_cpp_api
*/
typedef std::function<void(NetworkTable* parent, StringRef name,
NetworkTable* table)>
std::shared_ptr<NetworkTable> table)>
TableListener;
} // namespace nt