X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibmarklin%2Fcatalogue.h;h=5f13999dd26e7ed91fd648c60eec766d066d022a;hb=7839b7c3d782abb5c98a24d51cae109407068c02;hp=1a328bba1a70431b7486b55e3b78762a4049d8b0;hpb=6c61179fe09af2f5366d50f10aadbf5f83438087;p=r2c2.git diff --git a/source/libmarklin/catalogue.h b/source/libmarklin/catalogue.h index 1a328bb..5f13999 100644 --- a/source/libmarklin/catalogue.h +++ b/source/libmarklin/catalogue.h @@ -1,33 +1,45 @@ +/* $Id$ + +This file is part of the MSP Märklin suite +Copyright © 2006-2009 Mikkosoft Productions, Mikko Rasa +Distributed under the GPL +*/ + #ifndef LIBMARKLIN_CATALOGUE_H_ #define LIBMARKLIN_CATALOGUE_H_ #include -#include +#include namespace Marklin { -class Track; +class LocoType; +class TrackType; class Catalogue { public: - class Loader: public Msp::Parser::Loader + class Loader: public Msp::DataFile::BasicLoader { public: Loader(Catalogue &); private: - Catalogue &cat; - + void locomotive(unsigned); void track(unsigned); }; - typedef std::map TrackMap; - Track *get_track(unsigned); - const TrackMap &get_tracks() const { return tracks; } - void load(const std::string &); - ~Catalogue(); private: - TrackMap tracks; + std::map tracks; + std::map locos; + +public: + ~Catalogue(); + + TrackType &get_track(unsigned) const; + const std::map &get_tracks() const { return tracks; } + LocoType &get_locomotive(unsigned) const; + const std::map &get_locomotives() const { return locos; } + void load(const std::string &); }; } // namespace Marklin