]> git.tdb.fi Git - r2c2.git/blobdiff - source/libmarklin/track.h
Allow intercepting and denying turnout route and locomotive speed changes
[r2c2.git] / source / libmarklin / track.h
index c434224b527cf272a31b136eda574d977301700b..3c96a82d2cec51f6463c3e958d1b417c3ebb003a 100644 (file)
@@ -1,7 +1,7 @@
 /* $Id$
 
 This file is part of the MSP Märklin suite
-Copyright © 2006-2008 Mikkosoft Productions, Mikko Rasa
+Copyright © 2006-2009 Mikkosoft Productions, Mikko Rasa
 Distributed under the GPL
 */
 
@@ -20,14 +20,10 @@ class TrackType;
 class Track
 {
 public:
-       class Loader: public Msp::DataFile::Loader
+       class Loader: public Msp::DataFile::BasicLoader<Track>
        {
-       private:
-               Track &track;
-
        public:
                Loader(Track &);
-               Track &get_object() { return track; }
        private:
                void position(float, float, float);
        };
@@ -70,12 +66,15 @@ public:
        Track           *get_link(unsigned) const;
        void            check_slope();
        int             traverse(unsigned, unsigned) const;
+       Point           get_point(unsigned, unsigned, float) const;
 
        /**
        Creates a copy of the track.  The new track will be almost identical, but
        won't have any links to other tracks, nor a turnout or sensor id.
        */
        Track *copy() const;
+
+       void save(std::list<Msp::DataFile::Statement> &) const;
 private:
 
        // Direct copying not allowed due to links.  See the copy() function.