author | František Kučera <franta-hg@frantovo.cz> |
Sun, 03 Feb 2019 01:44:07 +0100 | |
branch | v_0 |
changeset 6 | 4062b8436838 |
child 11 | 9603e64324bc |
permissions | -rw-r--r-- |
6
4062b8436838
CLI parser: first version (only single relation is supported)
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
1 |
/** |
4062b8436838
CLI parser: first version (only single relation is supported)
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
2 |
* Relational pipes |
4062b8436838
CLI parser: first version (only single relation is supported)
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
3 |
* Copyright © 2019 František Kučera (Frantovo.cz, GlobalCode.info) |
4062b8436838
CLI parser: first version (only single relation is supported)
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
4 |
* |
4062b8436838
CLI parser: first version (only single relation is supported)
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
5 |
* This program is free software: you can redistribute it and/or modify |
4062b8436838
CLI parser: first version (only single relation is supported)
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
6 |
* it under the terms of the GNU General Public License as published by |
4062b8436838
CLI parser: first version (only single relation is supported)
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
7 |
* the Free Software Foundation, either version 3 of the License, or |
4062b8436838
CLI parser: first version (only single relation is supported)
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
8 |
* (at your option) any later version. |
4062b8436838
CLI parser: first version (only single relation is supported)
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
9 |
* |
4062b8436838
CLI parser: first version (only single relation is supported)
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
10 |
* This program is distributed in the hope that it will be useful, |
4062b8436838
CLI parser: first version (only single relation is supported)
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
4062b8436838
CLI parser: first version (only single relation is supported)
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4062b8436838
CLI parser: first version (only single relation is supported)
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
13 |
* GNU General Public License for more details. |
4062b8436838
CLI parser: first version (only single relation is supported)
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
14 |
* |
4062b8436838
CLI parser: first version (only single relation is supported)
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License |
4062b8436838
CLI parser: first version (only single relation is supported)
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
16 |
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
4062b8436838
CLI parser: first version (only single relation is supported)
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
17 |
*/ |
4062b8436838
CLI parser: first version (only single relation is supported)
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
18 |
#pragma once |
4062b8436838
CLI parser: first version (only single relation is supported)
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
19 |
|
4062b8436838
CLI parser: first version (only single relation is supported)
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
20 |
#include <vector> |
4062b8436838
CLI parser: first version (only single relation is supported)
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
21 |
#include <tuple> |
4062b8436838
CLI parser: first version (only single relation is supported)
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
22 |
|
4062b8436838
CLI parser: first version (only single relation is supported)
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
23 |
#include <relpipe/writer/AttributeMetadata.h> |
4062b8436838
CLI parser: first version (only single relation is supported)
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
24 |
#include <relpipe/writer/typedefs.h> |
4062b8436838
CLI parser: first version (only single relation is supported)
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
25 |
|
4062b8436838
CLI parser: first version (only single relation is supported)
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
26 |
namespace relpipe { |
4062b8436838
CLI parser: first version (only single relation is supported)
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
27 |
namespace tr { |
4062b8436838
CLI parser: first version (only single relation is supported)
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
28 |
namespace guile { |
4062b8436838
CLI parser: first version (only single relation is supported)
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
29 |
|
4062b8436838
CLI parser: first version (only single relation is supported)
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
30 |
class DefinitionRecipe { |
4062b8436838
CLI parser: first version (only single relation is supported)
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
31 |
public: |
4062b8436838
CLI parser: first version (only single relation is supported)
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
32 |
|
4062b8436838
CLI parser: first version (only single relation is supported)
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
33 |
virtual ~DefinitionRecipe() { |
4062b8436838
CLI parser: first version (only single relation is supported)
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
34 |
} |
4062b8436838
CLI parser: first version (only single relation is supported)
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
35 |
|
4062b8436838
CLI parser: first version (only single relation is supported)
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
36 |
relpipe::writer::string_t name; |
4062b8436838
CLI parser: first version (only single relation is supported)
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
37 |
relpipe::writer::string_t type; |
4062b8436838
CLI parser: first version (only single relation is supported)
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
38 |
relpipe::writer::string_t value; |
4062b8436838
CLI parser: first version (only single relation is supported)
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
39 |
}; |
4062b8436838
CLI parser: first version (only single relation is supported)
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
40 |
|
4062b8436838
CLI parser: first version (only single relation is supported)
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
41 |
class RelationConfiguration { |
4062b8436838
CLI parser: first version (only single relation is supported)
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
42 |
public: |
4062b8436838
CLI parser: first version (only single relation is supported)
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
43 |
|
4062b8436838
CLI parser: first version (only single relation is supported)
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
44 |
virtual ~RelationConfiguration() { |
4062b8436838
CLI parser: first version (only single relation is supported)
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
45 |
} |
4062b8436838
CLI parser: first version (only single relation is supported)
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
46 |
|
4062b8436838
CLI parser: first version (only single relation is supported)
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
47 |
relpipe::writer::string_t relation; |
4062b8436838
CLI parser: first version (only single relation is supported)
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
48 |
relpipe::writer::string_t guileBeforeRecords; |
4062b8436838
CLI parser: first version (only single relation is supported)
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
49 |
relpipe::writer::string_t guileAfterRecords; |
4062b8436838
CLI parser: first version (only single relation is supported)
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
50 |
relpipe::writer::string_t guileForEach; |
4062b8436838
CLI parser: first version (only single relation is supported)
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
51 |
relpipe::writer::string_t guileWhere; |
4062b8436838
CLI parser: first version (only single relation is supported)
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
52 |
/** |
4062b8436838
CLI parser: first version (only single relation is supported)
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
53 |
* If true, Guile code will be executed, but no output will be generated. |
4062b8436838
CLI parser: first version (only single relation is supported)
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
54 |
*/ |
4062b8436838
CLI parser: first version (only single relation is supported)
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
55 |
bool drop = false; |
4062b8436838
CLI parser: first version (only single relation is supported)
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
56 |
/** |
4062b8436838
CLI parser: first version (only single relation is supported)
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
57 |
* |
4062b8436838
CLI parser: first version (only single relation is supported)
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
58 |
*/ |
4062b8436838
CLI parser: first version (only single relation is supported)
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
59 |
std::vector<DefinitionRecipe> definitions; |
4062b8436838
CLI parser: first version (only single relation is supported)
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
60 |
/** |
4062b8436838
CLI parser: first version (only single relation is supported)
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
61 |
* If empty, output relation will have same metadata as the input relation. |
4062b8436838
CLI parser: first version (only single relation is supported)
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
62 |
*/ |
4062b8436838
CLI parser: first version (only single relation is supported)
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
63 |
std::vector<relpipe::writer::AttributeMetadata> writerMetadata; |
4062b8436838
CLI parser: first version (only single relation is supported)
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
64 |
}; |
4062b8436838
CLI parser: first version (only single relation is supported)
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
65 |
|
4062b8436838
CLI parser: first version (only single relation is supported)
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
66 |
class Configuration { |
4062b8436838
CLI parser: first version (only single relation is supported)
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
67 |
public: |
4062b8436838
CLI parser: first version (only single relation is supported)
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
68 |
vector<RelationConfiguration> relationConfigurations; |
4062b8436838
CLI parser: first version (only single relation is supported)
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
69 |
|
4062b8436838
CLI parser: first version (only single relation is supported)
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
70 |
virtual ~Configuration() { |
4062b8436838
CLI parser: first version (only single relation is supported)
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
71 |
} |
4062b8436838
CLI parser: first version (only single relation is supported)
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
72 |
}; |
4062b8436838
CLI parser: first version (only single relation is supported)
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
73 |
|
4062b8436838
CLI parser: first version (only single relation is supported)
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
74 |
} |
4062b8436838
CLI parser: first version (only single relation is supported)
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
75 |
} |
4062b8436838
CLI parser: first version (only single relation is supported)
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
76 |
} |