]> git.tdb.fi Git - r2c2.git/blobdiff - source/libmarklin/route.h
Add vehicles
[r2c2.git] / source / libmarklin / route.h
index bcb76e143635fa4b0180f24e698dfee292509bef..89788e3b62b477fc945229a96f4e1ede0ecbfc7f 100644 (file)
@@ -1,7 +1,7 @@
 /* $Id$
 
 This file is part of the MSP Märklin suite
-Copyright © 2007-2009  Mikkosoft Productions, Mikko Rasa
+Copyright © 2007-2010  Mikkosoft Productions, Mikko Rasa
 Distributed under the GPL
 */
 
@@ -11,15 +11,15 @@ Distributed under the GPL
 #include <map>
 #include <set>
 #include <string>
+#include <sigc++/trackable.h>
 #include <msp/datafile/loader.h>
 
 namespace Marklin {
 
 class Layout;
 class Track;
-class Turnout;
 
-class Route
+class Route: public sigc::trackable
 {
 public:
        class Loader: public Msp::DataFile::BasicLoader<Route>
@@ -31,12 +31,14 @@ public:
        };
 
 private:
+       Layout &layout;
        std::string name;
        std::set<const Track *> tracks;
        std::map<unsigned, int> turnouts;
 
 public:
        Route(Layout &, const std::string &);
+       ~Route();
 
        const std::string &get_name() const { return name; }
        int get_turnout(unsigned) const;
@@ -49,6 +51,10 @@ private:
        void update_turnouts();
        unsigned check_validity(const Track &) const;
        void track_removed(Track &);
+
+public:
+       static Route *find(const Track &, unsigned, const Track &);
+       static Route *find(const Track &, unsigned, const Route &);
 };
 
 } // namespace Marklin