parser sortof-works
[antikythera] / src / machine.h
index 86caa48..097157d 100644 (file)
@@ -2,6 +2,7 @@
 #define MACHINE_H_
 
 #include <vector>
+#include <map>
 #include "gear.h"
 
 struct Motor {
@@ -12,6 +13,7 @@ struct Motor {
 class Machine {
 private:
        std::vector<Gear*> gears;
+       std::map<Gear*, int> gearidx;
        bool **meshing;
        bool meshing_valid;
        bool *visited;  /* used for update_gear */
@@ -27,6 +29,8 @@ public:
        void add_gear(Gear *g); /* takes ownership */
        void add_motor(int gearidx, float speed_hz);
 
+       int get_gear_index(Gear *g) const;
+
        void invalidate_meshing();
        void calc_meshing();