#pragma once
#include <string>
#include "common.h"
namespace relpipe {
namespace writer {
/**
* This class contains common features that are independent from particular data type (generic/template type)
*/
class DataTypeWriterBase {
private:
const integer_t typeId;
const string_t typeCode;
public:
DataTypeWriterBase(const integer_t typeId, const string_t typeCode) :
typeId(typeId), typeCode(typeCode) {
}
virtual ~DataTypeWriterBase() {
};
virtual string_t readString(std::istream &input) = 0;
virtual void writeString(std::ostream& output, const string_t &stringValue) = 0;
/**
* @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);
/**
* @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);
integer_t getTypeId();
string_t getTypeCode();
};
}
}