src/DataTypeReaderBase.h
branchv_0
changeset 14 e8de089f95dd
parent 13 543f1613c2da
child 18 e11f1ad20826
--- a/src/DataTypeReaderBase.h	Sat Aug 25 17:39:27 2018 +0200
+++ b/src/DataTypeReaderBase.h	Sat Aug 25 18:16:53 2018 +0200
@@ -1,6 +1,7 @@
 #pragma once
 
 #include <string>
+#include "../include/relpipe/reader/TypeId.h"
 #include "../include/relpipe/reader/typedefs.h"
 
 namespace relpipe {
@@ -11,11 +12,11 @@
  */
 class DataTypeReaderBase {
 private:
-	const integer_t typeId;
+	const TypeId typeId;
 	const string_t typeCode;
 public:
 
-	DataTypeReaderBase(const integer_t typeId, const string_t typeCode) :
+	DataTypeReaderBase(const TypeId typeId, const string_t typeCode) :
 	typeId(typeId), typeCode(typeCode) {
 	}
 
@@ -35,17 +36,25 @@
 	 * @param dataType data type code as defined in DDP L0
 	 * @return whether this class supports conversions of this type
 	 */
-	virtual bool supports(const integer_t &dataType);
+	virtual bool supports(const TypeId &dataType) {
+		return dataType == typeId;
+	}
 
 	/**
 	 * @param dataType data type name as defined in DDP L0
 	 * @return whether this class supports conversions of this type
 	 */
-	virtual bool supports(const string_t &dataType);
+	virtual bool supports(const string_t &dataType) {
+		return dataType == typeCode;
+	}
 
-	integer_t getTypeId();
+	TypeId getTypeId() {
+		return typeId;
+	}
 
-	string_t getTypeCode();
+	string_t getTypeCode() {
+		return typeCode;
+	}
 };
 
 }