C++ NetworkTable: Provide AddSubTableListener().

This matches the implementation provided by Java NetworkTable, with the
exception that the subtable is not provided (because it's not a value).
The listener still can get access to the subtable by calling
source->getSubTable(key).
This commit is contained in:
Peter Johnson
2015-09-19 12:18:25 -07:00
parent a3effbfb9f
commit 4c83259acb
3 changed files with 35 additions and 0 deletions

View File

@@ -139,6 +139,7 @@ class NetworkTable : public ITable {
void AddTableListener(ITableListener* listener, bool immediateNotify);
void AddTableListener(llvm::StringRef key, ITableListener* listener,
bool immediateNotify);
void AddSubTableListener(ITableListener* listener);
void RemoveTableListener(ITableListener* listener);
/**

View File

@@ -220,6 +220,12 @@ class ITable {
virtual void AddTableListener(llvm::StringRef key, ITableListener* listener,
bool immediateNotify) = 0;
/**
* This will immediately notify the listener of all current sub tables
* @param listener the listener to add
*/
virtual void AddSubTableListener(ITableListener* listener) = 0;
/**
* Remove a listener from receiving table events
*