]> git.tdb.fi Git - r2c2.git/blob - source/libmarklin/locotype.h
190422ee7ec0b39a67f82169866c98c7646f78be
[r2c2.git] / source / libmarklin / locotype.h
1 /* $Id$
2
3 This file is part of the MSP Märklin suite
4 Copyright © 2006-2008 Mikkosoft Productions, Mikko Rasa
5 Distributed under the GPL
6 */
7
8 #ifndef LIBMARKLIN_LOCOTYPE_H_
9 #define LIBMARKLIN_LOCOTYPE_H_
10
11 #include <msp/datafile/loader.h>
12
13 namespace Marklin {
14
15 class LocoType
16 {
17 public:
18         class Loader: public Msp::DataFile::Loader
19         {
20         private:
21                 LocoType &ltype;
22
23         public:
24                 Loader(LocoType &);
25                 LocoType &get_object() const { return ltype; }
26         private:
27                 void function(unsigned, const std::string &);
28         };
29
30 private:
31         unsigned art_nr;
32         std::string name;
33         std::map<unsigned, std::string> funcs;
34
35 public:
36         LocoType(unsigned);
37         unsigned get_article_number() const { return art_nr; }
38         const std::string &get_name() const { return name; }
39         const std::map<unsigned, std::string> &get_functions() const { return funcs; }
40 };
41
42 } // namespace Marklin
43
44 #endif