author | František Kučera <franta-hg@frantovo.cz> |
Fri, 13 Jul 2018 23:02:09 +0200 | |
branch | v_0 |
changeset 3 | cdfb91189c9e |
parent 2 | 1a574113da20 |
child 4 | e6db28447957 |
permissions | -rw-r--r-- |
1 | 1 |
#pragma once |
2 |
||
3 |
#include <string> |
|
3
cdfb91189c9e
split common.h into typedefs.h and format.h
František Kučera <franta-hg@frantovo.cz>
parents:
2
diff
changeset
|
4 |
#include "typedefs.h" |
1 | 5 |
|
6 |
namespace relpipe { |
|
7 |
namespace writer { |
|
8 |
||
9 |
/** |
|
10 |
* This class contains common features that are independent from particular data type (generic/template type) |
|
11 |
*/ |
|
12 |
class DataTypeWriterBase { |
|
13 |
private: |
|
14 |
const integer_t typeId; |
|
15 |
const string_t typeCode; |
|
16 |
public: |
|
17 |
||
18 |
DataTypeWriterBase(const integer_t typeId, const string_t typeCode) : |
|
19 |
typeId(typeId), typeCode(typeCode) { |
|
20 |
} |
|
21 |
||
22 |
virtual ~DataTypeWriterBase() { |
|
23 |
}; |
|
24 |
||
25 |
virtual string_t readString(std::istream &input) = 0; |
|
26 |
||
27 |
virtual void writeString(std::ostream& output, const string_t &stringValue) = 0; |
|
28 |
||
29 |
/** |
|
30 |
* @param dataType data type code as defined in DDP L0 |
|
31 |
* @return whether this class supports conversions of this type |
|
32 |
*/ |
|
33 |
virtual bool supports(const integer_t &dataType); |
|
34 |
||
35 |
/** |
|
36 |
* @param dataType data type name as defined in DDP L0 |
|
37 |
* @return whether this class supports conversions of this type |
|
38 |
*/ |
|
39 |
virtual bool supports(const string_t &dataType); |
|
40 |
||
41 |
integer_t getTypeId(); |
|
42 |
||
43 |
string_t getTypeCode(); |
|
44 |
}; |
|
45 |
||
46 |
} |
|
47 |
} |