This is the latest WPILib src, VisionSample2013, cRIO image, ... pulled down from firstforge.wpi.edu.
There might be risks in using the top of tree rather than an official release, but the commit messages do mention fixes for some deadlocks and race conditions.
git-svn-id: https://robotics.mvla.net/svn/frc971/2013/trunk/src@4066 f308d9b7-e957-4cde-b6ac-9a88185e7312
diff --git a/azaleasource/WPILibCProgramming/trunk/WPILib/tables/IRemote.h b/azaleasource/WPILibCProgramming/trunk/WPILib/tables/IRemote.h
new file mode 100644
index 0000000..757f0ed
--- /dev/null
+++ b/azaleasource/WPILibCProgramming/trunk/WPILib/tables/IRemote.h
@@ -0,0 +1,55 @@
+/*
+ * IRemote.h
+ *
+ * Created on: Sep 22, 2012
+ * Author: Mitchell Wills
+ */
+
+#ifndef IREMOTE_H_
+#define IREMOTE_H_
+
+class IRemote;
+
+
+#include "IRemoteConnectionListener.h"
+
+
+
+/**
+ * Represents an object that has a remote connection
+ *
+ * @author Mitchell
+ *
+ */
+class IRemote {
+public:
+ /**
+ * Register an object to listen for connection and disconnection events
+ *
+ * @param listener the listener to be register
+ * @param immediateNotify if the listener object should be notified of the current connection state
+ */
+ virtual void AddConnectionListener(IRemoteConnectionListener* listener, bool immediateNotify) = 0;
+
+ /**
+ * Unregister a listener from connection events
+ *
+ * @param listener the listener to be unregistered
+ */
+ virtual void RemoveConnectionListener(IRemoteConnectionListener* listener) = 0;
+
+ /**
+ * Get the current state of the objects connection
+ * @return the current connection state
+ */
+ virtual bool IsConnected() = 0;
+
+ /**
+ * If the object is acting as a server
+ * @return if the object is a server
+ */
+ virtual bool IsServer() = 0;
+};
+
+
+#endif /* IREMOTE_H_ */
diff --git a/azaleasource/WPILibCProgramming/trunk/WPILib/tables/IRemoteConnectionListener.h b/azaleasource/WPILibCProgramming/trunk/WPILib/tables/IRemoteConnectionListener.h
new file mode 100644
index 0000000..229e68e
--- /dev/null
+++ b/azaleasource/WPILibCProgramming/trunk/WPILib/tables/IRemoteConnectionListener.h
@@ -0,0 +1,40 @@
+/*
+ * IRemoteConnectionListener.h
+ *
+ * Created on: Sep 22, 2012
+ * Author: Mitchell Wills
+ */
+
+#ifndef IREMOTECONNECTIONLISTENER_H_
+#define IREMOTECONNECTIONLISTENER_H_
+
+
+class IRemoteConnectionListener;
+
+#include "IRemote.h"
+
+
+
+/**
+ * A listener that listens for connection changes in a {@link IRemote} object
+ *
+ * @author Mitchell
+ *
+ */
+class IRemoteConnectionListener {
+public:
+ /**
+ * Called when an IRemote is connected
+ * @param remote the object that connected
+ */
+ virtual void Connected(IRemote* remote) = 0;
+ /**
+ * Called when an IRemote is disconnected
+ * @param remote the object that disconnected
+ */
+ virtual void Disconnected(IRemote* remote) = 0;
+};
+
+
+
+#endif /* IREMOTECONNECTIONLISTENER_H_ */
diff --git a/azaleasource/WPILibCProgramming/trunk/WPILib/tables/ITable.h b/azaleasource/WPILibCProgramming/trunk/WPILib/tables/ITable.h
new file mode 100644
index 0000000..5d12b31
--- /dev/null
+++ b/azaleasource/WPILibCProgramming/trunk/WPILib/tables/ITable.h
@@ -0,0 +1,194 @@
+/*
+ * ITable.h
+ *
+ * Created on: Sep 19, 2012
+ * Author: Mitchell Wills
+ */
+
+#ifndef ITABLE_H_
+#define ITABLE_H_
+
+
+class ITable;
+union EntryValue{
+ void* ptr;
+ bool b;
+ double f;
+};
+typedef union EntryValue EntryValue;
+
+
+#include <string>
+#include "networktables2/type/ComplexData.h"
+#include "ITableListener.h"
+
+
+class ITable {
+public:
+
+ /**
+ * Determines whether the given key is in this table.
+ *
+ * @param key the key to search for
+ * @return true if the table as a value assigned to the given key
+ */
+ virtual bool ContainsKey(std::string key) = 0;
+
+ /**
+ * Determines whether there exists a non-empty subtable for this key
+ * in this table.
+ *
+ * @param key the key to search for
+ * @return true if there is a subtable with the key which contains at least one key/subtable of its own
+ */
+ virtual bool ContainsSubTable(std::string key) = 0;
+
+ /**
+ * Gets the subtable in this table for the given name.
+ *
+ * @param key the name of the table relative to this one
+ * @return a sub table relative to this one
+ */
+ virtual ITable* GetSubTable(std::string key) = 0;
+
+
+ /**
+ * Gets the value associated with a key as an object
+ *
+ * @param key the key of the value to look up
+ * @return the value associated with the given key
+ * @throws TableKeyNotDefinedException if there is no value associated with the given key
+ */
+ virtual EntryValue GetValue(std::string key) = 0;
+ /**
+ * Put a value in the table
+ *
+ * @param key the key to be assigned to
+ * @param value the value that will be assigned
+ * @throws IllegalArgumentException when the value is not supported by the table
+ */
+ virtual void PutValue(std::string key, ComplexData& value) = 0;
+
+ virtual void RetrieveValue(std::string key, ComplexData& externalValue) = 0;
+
+
+
+ /**
+ * Put a number in the table
+ *
+ * @param key the key to be assigned to
+ * @param value the value that will be assigned
+ */
+ virtual void PutNumber(std::string key, double value) = 0;
+ /**
+ * Gets the number associated with the given name.
+ *
+ * @param key the key to look up
+ * @return the value associated with the given key
+ * @throws TableKeyNotDefinedException if there is no value associated with the given key
+ */
+ virtual double GetNumber(std::string key) = 0;
+ /**
+ * Gets the number associated with the given name.
+ *
+ * @param key the key to look up
+ * @param defaultValue the value to be returned if no value is found
+ * @return the value associated with the given key or the given default value if there is no value associated with the key
+ */
+ virtual double GetNumber(std::string key, double defaultValue) = 0;
+
+ /**
+ * Put a std::string& in the table
+ *
+ * @param key the key to be assigned to
+ * @param value the value that will be assigned
+ */
+ virtual void PutString(std::string key, std::string value) = 0;
+
+ /**
+ * Gets the string associated with the given name.
+ *
+ * @param key the key to look up
+ * @return the value associated with the given key
+ * @throws TableKeyNotDefinedException if there is no value associated with the given key
+ */
+ virtual std::string GetString(std::string key) = 0;
+
+ /**
+ * Gets the string associated with the given name.
+ *
+ * @param key the key to look up
+ * @param defaultValue the value to be returned if no value is found
+ * @return the value associated with the given key or the given default value if there is no value associated with the key
+ */
+ virtual std::string GetString(std::string key, std::string defaultValue) = 0;
+
+ /**
+ * Put a boolean in the table
+ *
+ * @param key the key to be assigned to
+ * @param value the value that will be assigned
+ */
+ virtual void PutBoolean(std::string key, bool value) = 0;
+
+ /**
+ * Gets the boolean associated with the given name.
+ *
+ * @param key the key to look up
+ * @return the value associated with the given key
+ * @throws TableKeyNotDefinedException if there is no value associated with the given key
+ */
+ virtual bool GetBoolean(std::string key) = 0;
+
+ /**
+ * Gets the boolean associated with the given name.
+ *
+ * @param key the key to look up
+ * @param defaultValue the value to be returned if no value is found
+ * @return the value associated with the given key or the given default value if there is no value associated with the key
+ */
+ virtual bool GetBoolean(std::string key, bool defaultValue) = 0;
+
+ /**
+ * Add a listener for changes to the table
+ *
+ * @param listener the listener to add
+ */
+ virtual void AddTableListener(ITableListener* listener) = 0;
+
+ /**
+ * Add a listener for changes to the table
+ *
+ * @param listener the listener to add
+ * @param immediateNotify if true then this listener will be notified of all current entries (marked as new)
+ */
+ virtual void AddTableListener(ITableListener* listener, bool immediateNotify) = 0;
+
+ /**
+ * Add a listener for changes to a specific key the table
+ *
+ * @param key the key to listen for
+ * @param listener the listener to add
+ * @param immediateNotify if true then this listener will be notified of all current entries (marked as new)
+ */
+ virtual void AddTableListener(std::string key, ITableListener* listener, bool immediateNotify) = 0;
+
+ /**
+ * This will immediately notify the listener of all current sub tables
+ *
+ * @param listener
+ */
+ virtual void AddSubTableListener(ITableListener* listener) = 0;
+
+ /**
+ * Remove a listener from receiving table events
+ *
+ * @param listener the listener to be removed
+ */
+ virtual void RemoveTableListener(ITableListener* listener) = 0;
+
+
+};
+
+
+#endif /* ITABLE_H_ */
diff --git a/azaleasource/WPILibCProgramming/trunk/WPILib/tables/ITableListener.h b/azaleasource/WPILibCProgramming/trunk/WPILib/tables/ITableListener.h
new file mode 100644
index 0000000..ab1d0c3
--- /dev/null
+++ b/azaleasource/WPILibCProgramming/trunk/WPILib/tables/ITableListener.h
@@ -0,0 +1,41 @@
+/*
+ * ITableListener.h
+ *
+ * Created on: Sep 19, 2012
+ * Author: Mitchell Wills
+ */
+
+#ifndef ITABLELISTENER_H_
+#define ITABLELISTENER_H_
+
+
+class ITableListener;
+
+
+#include "ITable.h"
+
+
+
+
+/**
+ * A listener that listens to changes in values in a {@link ITable}
+ *
+ * @author Mitchell
+ *
+ */
+class ITableListener {
+ public:
+ /**
+ * Called when a key-value pair is changed in a {@link ITable}
+ * WARNING: If a new key-value is put in this method value changed will immediatly be called which could lead to recursive code
+ * @param source the table the key-value pair exists in
+ * @param key the key associated with the value that changed
+ * @param value the new value
+ * @param isNew true if the key did not previously exist in the table, otherwise it is false
+ */
+ virtual void ValueChanged(ITable* source, const std::string& key, EntryValue value, bool isNew) = 0;
+};
+
+
+
+#endif /* ITABLELISTENER_H_ */
diff --git a/azaleasource/WPILibCProgramming/trunk/WPILib/tables/ITableProvider.h b/azaleasource/WPILibCProgramming/trunk/WPILib/tables/ITableProvider.h
new file mode 100644
index 0000000..f4bbb64
--- /dev/null
+++ b/azaleasource/WPILibCProgramming/trunk/WPILib/tables/ITableProvider.h
@@ -0,0 +1,32 @@
+/*
+ * ITableProvider.h
+ *
+ * Created on: Sep 22, 2012
+ * Author: Mitchell Wills
+ */
+
+#ifndef ITABLEPROVIDER_H_
+#define ITABLEPROVIDER_H_
+
+
+class ITableProvider;
+
+#include "tables/ITable.h"
+
+
+/**
+ * A simple interface to provide tables
+ *
+ * @author Mitchell
+ *
+ */
+class ITableProvider {
+ /**
+ * Get a table by name
+ * @param name the name of the table
+ * @return a Table with the given name
+ */
+ virtual ITable* GetTable(std::string name) = 0;
+};
+
+#endif /* ITABLEPROVIDER_H_ */
diff --git a/azaleasource/WPILibCProgramming/trunk/WPILib/tables/TableKeyNotDefinedException.cpp b/azaleasource/WPILibCProgramming/trunk/WPILib/tables/TableKeyNotDefinedException.cpp
new file mode 100644
index 0000000..46ae88f
--- /dev/null
+++ b/azaleasource/WPILibCProgramming/trunk/WPILib/tables/TableKeyNotDefinedException.cpp
@@ -0,0 +1,24 @@
+/*
+ * TableKeyNotDefinedException.cpp
+ *
+ * Created on: Sep 22, 2012
+ * Author: Mitchell Wills
+ */
+
+#include "tables/TableKeyNotDefinedException.h"
+#include <stdlib.h>
+#include <cstring>
+
+
+#define MESSAGE_PREFIX "Unkown Table Key: "
+TableKeyNotDefinedException::TableKeyNotDefinedException(const std::string key):
+msg(MESSAGE_PREFIX + key){
+
+}
+
+const char* TableKeyNotDefinedException::what(){
+ return msg.c_str();
+}
+
+TableKeyNotDefinedException::~TableKeyNotDefinedException() throw(){
+}
diff --git a/azaleasource/WPILibCProgramming/trunk/WPILib/tables/TableKeyNotDefinedException.h b/azaleasource/WPILibCProgramming/trunk/WPILib/tables/TableKeyNotDefinedException.h
new file mode 100644
index 0000000..1da9913
--- /dev/null
+++ b/azaleasource/WPILibCProgramming/trunk/WPILib/tables/TableKeyNotDefinedException.h
@@ -0,0 +1,40 @@
+/*
+ * TableKeyNotDefinedException.h
+ *
+ * Created on: Sep 22, 2012
+ * Author: Mitchell Wills
+ */
+
+#ifndef TABLEKEYNOTDEFINEDEXCEPTION_H_
+#define TABLEKEYNOTDEFINEDEXCEPTION_H_
+
+
+class TableKeyNotDefinedException;
+
+
+#include <exception>
+#include <string>
+
+
+/**
+ * An exception throw when the lookup a a key-value fails in a {@link ITable}
+ *
+ * @author Mitchell
+ *
+ */
+class TableKeyNotDefinedException : public std::exception {
+public:
+ /**
+ * @param key the key that was not defined in the table
+ */
+ TableKeyNotDefinedException(const std::string key);
+ ~TableKeyNotDefinedException() throw();
+ const char* what();
+private:
+ const std::string msg;
+};
+
+
+
+
+#endif /* TABLEKEYNOTDEFINEDEXCEPTION_H_ */