]> git.tdb.fi Git - r2c2.git/blobdiff - source/libr2c2/objecttype.h
Add a common base class for tangible objects
[r2c2.git] / source / libr2c2 / objecttype.h
diff --git a/source/libr2c2/objecttype.h b/source/libr2c2/objecttype.h
new file mode 100644 (file)
index 0000000..0cca264
--- /dev/null
@@ -0,0 +1,35 @@
+#ifndef LIBR2C2_OBJECTTYPE_H_
+#define LIBR2C2_OBJECTTYPE_H_
+
+#include <string>
+#include <msp/datafile/objectloader.h>
+#include "articlenumber.h"
+
+namespace R2C2 {
+
+class ObjectType
+{
+public:
+       class Loader: public Msp::DataFile::ObjectLoader<ObjectType>
+       {
+       public:
+               Loader(ObjectType &);
+       };
+
+protected:
+       ArticleNumber art_nr;
+       std::string name;
+       std::string description;
+
+       ObjectType(const ArticleNumber &a): art_nr(a) { }
+public:
+       virtual ~ObjectType() { }
+
+       const ArticleNumber &get_article_number() const { return art_nr; }
+       const std::string &get_name() const { return name; }
+       const std::string &get_description() const { return description; }
+};
+
+} // namespace R2C2
+
+#endif