]> git.tdb.fi Git - r2c2.git/blob - source/libmarklin/catalogue.h
Initial revision
[r2c2.git] / source / libmarklin / catalogue.h
1 #ifndef LIBMARKLIN_CATALOGUE_H_
2 #define LIBMARKLIN_CATALOGUE_H_
3
4 #include <map>
5 #include <msp/parser/loader.h>
6
7 namespace Marklin {
8
9 class Track;
10
11 class Catalogue
12 {
13 public:
14         class Loader: public Msp::Parser::Loader
15         {
16         public:
17                 Loader(Catalogue &);
18         private:
19                 Catalogue &cat;
20
21                 void track(unsigned);
22         };
23         typedef std::map<unsigned, Track *> TrackMap;
24
25         Track *get_track(unsigned);
26         const TrackMap &get_tracks() const { return tracks; }
27         void  load(const std::string &);
28         ~Catalogue();
29 private:
30         TrackMap tracks;
31 };
32
33 } // namespace Marklin
34
35 #endif