copied everything over from 2012 and removed all of the actual robot code except the drivetrain stuff
git-svn-id: https://robotics.mvla.net/svn/frc971/2013/trunk/src@4078 f308d9b7-e957-4cde-b6ac-9a88185e7312
diff --git a/aos/common/input/SensorInput.h b/aos/common/input/SensorInput.h
new file mode 100644
index 0000000..7f8eaa7
--- /dev/null
+++ b/aos/common/input/SensorInput.h
@@ -0,0 +1,36 @@
+#ifndef AOS_INPUT_SENSOR_INPUT_H_
+#define AOS_INPUT_SENSOR_INPUT_H_
+
+#include "aos/aos_core.h"
+#ifdef __VXWORKS__
+#include <vector>
+#include <semLib.h>
+#endif
+
+namespace aos {
+
+// Class for implementing code that takes information from a sensor struct and
+// places it into queues. Subclasses should be compiled for both the atom and
+// the crio to support crio control loops.
+template<class Values> class SensorInput {
+ protected:
+ virtual void RunIteration(Values &values) = 0;
+ public:
+ // Enters an infinite loop that reads values and calls RunIteration.
+ void Run();
+
+#ifdef __VXWORKS__
+ // Calls RunIteration on all instances with values.
+ static void RunIterationAll(Values &values);
+ private:
+ static SEM_ID lock_;
+ static std::vector<SensorInput *> running_;
+#endif
+};
+
+} // namespace aos
+
+#include "SensorInput-tmpl.h"
+
+#endif
+