mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
This is the changes made by Patrick Plenefisch converting the native code to use CMake and the CMake Maven Plugin, as opposed to the native Maven plugin. This is to allow for compatibility with newer versions of the GCC toolchain. All the cpp sources were moved from maven style directories to cpp style directories for CMake. Change-Id: I67f5e3608948f37c83b0990d232105a3784f8593
43 lines
811 B
C++
43 lines
811 B
C++
#include <map>
|
|
#include <string>
|
|
|
|
#include "tables/ITableProvider.h"
|
|
#include "networktables2/NetworkTableNode.h"
|
|
#include "networktables/NetworkTable.h"
|
|
|
|
|
|
#include "networktables/NetworkTableProvider.h"
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
NetworkTableProvider::NetworkTableProvider(NetworkTableNode& _node) : node(_node){}
|
|
NetworkTableProvider::~NetworkTableProvider(){
|
|
while(tables.size()>0){
|
|
map<std::string, NetworkTable*>::iterator it = tables.begin();
|
|
delete it->second;
|
|
tables.erase(it);
|
|
}
|
|
}
|
|
|
|
ITable* NetworkTableProvider::GetRootTable(){
|
|
return GetTable("");
|
|
}
|
|
|
|
ITable* NetworkTableProvider::GetTable(std::string key){
|
|
if(tables.find(key) != tables.end())
|
|
{
|
|
return tables[key];
|
|
}
|
|
else
|
|
{
|
|
NetworkTable* table = new NetworkTable(key, *this);
|
|
tables[key] = table;
|
|
return table;
|
|
}
|
|
}
|
|
|