]> git.tdb.fi Git - r2c2.git/blob - source/libmarklin/locotype.h
5fd34d8c32f20d56d043075e7fa5dfd9d72ed985
[r2c2.git] / source / libmarklin / locotype.h
1 /* $Id$
2
3 This file is part of the MSP Märklin suite
4 Copyright © 2006-2009  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::BasicLoader<LocoType>
19         {
20         public:
21                 Loader(LocoType &);
22         private:
23                 void function(unsigned, const std::string &);
24         };
25
26 private:
27         unsigned art_nr;
28         std::string name;
29         std::map<unsigned, std::string> funcs;
30
31 public:
32         LocoType(unsigned);
33         unsigned get_article_number() const { return art_nr; }
34         const std::string &get_name() const { return name; }
35         unsigned get_max_function() const;
36         const std::map<unsigned, std::string> &get_functions() const { return funcs; }
37 };
38
39 } // namespace Marklin
40
41 #endif