author | František Kučera <franta-hg@frantovo.cz> |
Sun, 22 Jul 2018 17:19:25 +0200 | |
branch | v_0 |
changeset 16 | 3613617d3076 |
parent 15 | 8fd6c4d44071 |
child 17 | f2cccaa9dd38 |
permissions | -rw-r--r-- |
7
01dd90eeedbb
add data type and catalog classes from the prototype
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
1 |
#pragma once |
01dd90eeedbb
add data type and catalog classes from the prototype
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
2 |
|
01dd90eeedbb
add data type and catalog classes from the prototype
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
3 |
#include <string> |
01dd90eeedbb
add data type and catalog classes from the prototype
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
4 |
#include <iostream> |
01dd90eeedbb
add data type and catalog classes from the prototype
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
5 |
#include <vector> |
01dd90eeedbb
add data type and catalog classes from the prototype
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
6 |
|
13
e7234dd45166
use TypeId enum instead of numeric constants
František Kučera <franta-hg@frantovo.cz>
parents:
11
diff
changeset
|
7 |
#include "typedefs.h" |
e7234dd45166
use TypeId enum instead of numeric constants
František Kučera <franta-hg@frantovo.cz>
parents:
11
diff
changeset
|
8 |
#include "TypeId.h" |
7
01dd90eeedbb
add data type and catalog classes from the prototype
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
9 |
|
8
03750aff8619
writer only writes + refactoring
František Kučera <franta-hg@frantovo.cz>
parents:
7
diff
changeset
|
10 |
namespace relpipe { |
03750aff8619
writer only writes + refactoring
František Kučera <franta-hg@frantovo.cz>
parents:
7
diff
changeset
|
11 |
namespace writer { |
7
01dd90eeedbb
add data type and catalog classes from the prototype
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
12 |
|
9
0a40752e401d
shared library with pure abstract class (interface)
František Kučera <franta-hg@frantovo.cz>
parents:
8
diff
changeset
|
13 |
class RelationalWriter { |
7
01dd90eeedbb
add data type and catalog classes from the prototype
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
14 |
public: |
01dd90eeedbb
add data type and catalog classes from the prototype
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
15 |
|
9
0a40752e401d
shared library with pure abstract class (interface)
František Kučera <franta-hg@frantovo.cz>
parents:
8
diff
changeset
|
16 |
virtual ~RelationalWriter() = default; |
0a40752e401d
shared library with pure abstract class (interface)
František Kučera <franta-hg@frantovo.cz>
parents:
8
diff
changeset
|
17 |
|
15
8fd6c4d44071
use more TypeId enum
František Kučera <franta-hg@frantovo.cz>
parents:
14
diff
changeset
|
18 |
virtual TypeId toTypeId(const string_t typeCode) = 0; |
9
0a40752e401d
shared library with pure abstract class (interface)
František Kučera <franta-hg@frantovo.cz>
parents:
8
diff
changeset
|
19 |
|
15
8fd6c4d44071
use more TypeId enum
František Kučera <franta-hg@frantovo.cz>
parents:
14
diff
changeset
|
20 |
virtual string_t toTypeCode(const TypeId typeId) = 0; |
7
01dd90eeedbb
add data type and catalog classes from the prototype
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
21 |
|
13
e7234dd45166
use TypeId enum instead of numeric constants
František Kučera <franta-hg@frantovo.cz>
parents:
11
diff
changeset
|
22 |
virtual void startRelation(string_t name, std::vector<std::pair<string_t, TypeId>> attributes, boolean_t writeHeader) = 0; |
7
01dd90eeedbb
add data type and catalog classes from the prototype
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
23 |
|
9
0a40752e401d
shared library with pure abstract class (interface)
František Kučera <franta-hg@frantovo.cz>
parents:
8
diff
changeset
|
24 |
virtual void writeRecord(std::vector<string_t> attributes) = 0; |
16
3613617d3076
writeAttribute() with raw pointer and type_info
František Kučera <franta-hg@frantovo.cz>
parents:
15
diff
changeset
|
25 |
|
3613617d3076
writeAttribute() with raw pointer and type_info
František Kučera <franta-hg@frantovo.cz>
parents:
15
diff
changeset
|
26 |
// TODO: write bitmap + attribute: |
3613617d3076
writeAttribute() with raw pointer and type_info
František Kučera <franta-hg@frantovo.cz>
parents:
15
diff
changeset
|
27 |
// virtual void writeBitmap(...) = 0; |
3613617d3076
writeAttribute() with raw pointer and type_info
František Kučera <franta-hg@frantovo.cz>
parents:
15
diff
changeset
|
28 |
// virtual void writeAttribute(string_t attribute) = 0; |
3613617d3076
writeAttribute() with raw pointer and type_info
František Kučera <franta-hg@frantovo.cz>
parents:
15
diff
changeset
|
29 |
|
3613617d3076
writeAttribute() with raw pointer and type_info
František Kučera <franta-hg@frantovo.cz>
parents:
15
diff
changeset
|
30 |
virtual void writeAttribute(const void* value, const std::type_info& type) = 0; |
7
01dd90eeedbb
add data type and catalog classes from the prototype
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
31 |
|
01dd90eeedbb
add data type and catalog classes from the prototype
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
32 |
}; |
01dd90eeedbb
add data type and catalog classes from the prototype
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
33 |
|
8
03750aff8619
writer only writes + refactoring
František Kučera <franta-hg@frantovo.cz>
parents:
7
diff
changeset
|
34 |
} |
9
0a40752e401d
shared library with pure abstract class (interface)
František Kučera <franta-hg@frantovo.cz>
parents:
8
diff
changeset
|
35 |
} |