]> git.tdb.fi Git - r2c2.git/blobdiff - source/libmarklin/catalogue.h
Add Id tags and copyright notices to files
[r2c2.git] / source / libmarklin / catalogue.h
index 1a328bba1a70431b7486b55e3b78762a4049d8b0..7ce3e73c0d30a3d98cd252a8f0d47a726d200b88 100644 (file)
@@ -1,33 +1,47 @@
+/* $Id$
+
+This file is part of the MSP Märklin suite
+Copyright © 2006-2008 Mikkosoft Productions, Mikko Rasa
+Distributed under the GPL
+*/
+
 #ifndef LIBMARKLIN_CATALOGUE_H_
 #define LIBMARKLIN_CATALOGUE_H_
 
 #include <map>
-#include <msp/parser/loader.h>
+#include <msp/datafile/loader.h>
 
 namespace Marklin {
 
-class Track;
+class LocoType;
+class TrackType;
 
 class Catalogue
 {
 public:
-       class Loader: public Msp::Parser::Loader
+       class Loader: public Msp::DataFile::Loader
        {
        public:
                Loader(Catalogue &);
        private:
                Catalogue &cat;
 
+               void locomotive(unsigned);
                void track(unsigned);
        };
-       typedef std::map<unsigned, Track *> TrackMap;
 
-       Track *get_track(unsigned);
-       const TrackMap &get_tracks() const { return tracks; }
-       void  load(const std::string &);
-       ~Catalogue();
 private:
-       TrackMap tracks;
+       std::map<unsigned, TrackType *> tracks;
+       std::map<unsigned, LocoType *> locos;
+
+public:
+       ~Catalogue();
+
+       TrackType &get_track(unsigned) const;
+       const std::map<unsigned, TrackType *> &get_tracks() const { return tracks; }
+       LocoType &get_locomotive(unsigned) const;
+       const std::map<unsigned, LocoType *> &get_locomotives() const { return locos; }
+       void  load(const std::string &);
 };
 
 } // namespace Marklin