View Single Post
  #2   Spotlight this post!  
Unread 19-02-2012, 20:33
patrickviolette patrickviolette is offline
Registered User
FRC #1318
 
Join Date: Jan 2012
Location: Issaquah, WA
Posts: 8
patrickviolette is an unknown quantity at this point
Re: NetworkTable : Tables, SubTables

It seems like--in Java, at least--the tables are simply hash tables with buckets. Each bucket can contain any type of data..eg double, boolean, or even another NetworkTable. So adding a subtable in Java looks like:

NetworkTable add = new NetworkTable();
NetworkTable.getTable("main").putSubTable("aSubTab le", add);

We have gotten errors if we try to access a subtable that we have not created yet.

NetworkTable.getTable("main").getSubTable("camera" ).putDouble("x", 40);
//does not work, unless you have put the "camera" subtable into the main table previously

Again, we are using Java, so it may be implemented somewhat differently in C++. Hope that helps, though.
Reply With Quote