equal
deleted
inserted
replaced
|
1 #pragma once |
|
2 |
|
3 #include "DataTypeWriterBase.h" |
|
4 |
|
5 namespace relpipe { |
|
6 namespace writer { |
|
7 |
|
8 template<typename T> class DataTypeWriter : public DataTypeWriterBase { |
|
9 public: |
|
10 |
|
11 DataTypeWriter(const integer_t typeId, const string_t typeCode) : DataTypeWriterBase(typeId, typeCode) { |
|
12 } |
|
13 |
|
14 virtual ~DataTypeWriter() { |
|
15 }; |
|
16 |
|
17 virtual void writeValue(std::ostream& output, const T& value) = 0; |
|
18 |
|
19 void writeString(std::ostream& output, const string_t &stringValue) override { |
|
20 writeValue(output, toValue(stringValue)); |
|
21 } |
|
22 |
|
23 virtual T toValue(const string_t &stringValue) = 0; |
|
24 |
|
25 }; |
|
26 |
|
27 } |
|
28 } |