]> git.tdb.fi Git - r2c2.git/blob - source/libr2c2/signaltype.h
Add basic support for signals
[r2c2.git] / source / libr2c2 / signaltype.h
1 #ifndef LIBR2C2_SIGNALTYPE_H_
2 #define LIBR2C2_SIGNALTYPE_H_
3
4 #include <msp/datafile/objectloader.h>
5 #include "articlenumber.h"
6
7 namespace R2C2 {
8
9 class SignalType
10 {
11 public:
12         struct Indication
13         {
14                 class Loader: public Msp::DataFile::ObjectLoader<Indication>
15                 {
16                 public:
17                         Loader(Indication &);
18                 };
19
20                 std::string name;
21                 unsigned aspect;
22                 unsigned free_blocks;
23         };
24
25         class Loader: public Msp::DataFile::ObjectLoader<SignalType>
26         {
27         public:
28                 Loader(SignalType &);
29         private:
30                 void indication(const std::string &);
31         };
32
33         typedef std::list<Indication> IndicationList;
34
35 private:
36         ArticleNumber art_nr;
37         std::string description;
38         IndicationList indications;
39         std::string object;
40
41 public:
42         SignalType(const ArticleNumber &);
43
44         const ArticleNumber &get_article_number() const { return art_nr; }
45         const IndicationList &get_indications() const { return indications; }
46         const std::string &get_object() const { return object; }
47 };
48
49 } // namespace R2C2
50
51 #endif