]> git.tdb.fi Git - r2c2.git/blobdiff - source/libr2c2/signaltype.h
Add basic support for signals
[r2c2.git] / source / libr2c2 / signaltype.h
diff --git a/source/libr2c2/signaltype.h b/source/libr2c2/signaltype.h
new file mode 100644 (file)
index 0000000..4499d7e
--- /dev/null
@@ -0,0 +1,51 @@
+#ifndef LIBR2C2_SIGNALTYPE_H_
+#define LIBR2C2_SIGNALTYPE_H_
+
+#include <msp/datafile/objectloader.h>
+#include "articlenumber.h"
+
+namespace R2C2 {
+
+class SignalType
+{
+public:
+       struct Indication
+       {
+               class Loader: public Msp::DataFile::ObjectLoader<Indication>
+               {
+               public:
+                       Loader(Indication &);
+               };
+
+               std::string name;
+               unsigned aspect;
+               unsigned free_blocks;
+       };
+
+       class Loader: public Msp::DataFile::ObjectLoader<SignalType>
+       {
+       public:
+               Loader(SignalType &);
+       private:
+               void indication(const std::string &);
+       };
+
+       typedef std::list<Indication> IndicationList;
+
+private:
+       ArticleNumber art_nr;
+       std::string description;
+       IndicationList indications;
+       std::string object;
+
+public:
+       SignalType(const ArticleNumber &);
+
+       const ArticleNumber &get_article_number() const { return art_nr; }
+       const IndicationList &get_indications() const { return indications; }
+       const std::string &get_object() const { return object; }
+};
+
+} // namespace R2C2
+
+#endif