author | František Kučera <franta-hg@frantovo.cz> |
Sat, 04 Dec 2021 21:14:53 +0100 | |
branch | v_0 |
changeset 11 | 0d49d5041a84 |
parent 3 | 9f2d6645ebe6 |
permissions | -rw-r--r-- |
0 | 1 |
/** |
2 |
* Relational pipes |
|
3 |
* Copyright © 2021 František Kučera (Frantovo.cz, GlobalCode.info) |
|
4 |
* |
|
5 |
* This program is free software: you can redistribute it and/or modify |
|
6 |
* it under the terms of the GNU General Public License as published by |
|
7 |
* the Free Software Foundation, version 3 of the License. |
|
8 |
* |
|
9 |
* This program is distributed in the hope that it will be useful, |
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 |
* GNU General Public License for more details. |
|
13 |
* |
|
14 |
* You should have received a copy of the GNU General Public License |
|
15 |
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
16 |
*/ |
|
17 |
#pragma once |
|
18 |
||
19 |
#include <map> |
|
20 |
#include <regex> |
|
21 |
#include <locale> |
|
22 |
||
23 |
#include <relpipe/common/type/typedefs.h> |
|
24 |
||
25 |
||
26 |
namespace relpipe { |
|
27 |
namespace tr { |
|
28 |
namespace infertypes { |
|
29 |
||
30 |
enum class MODE { |
|
31 |
AUTO, |
|
32 |
METADATA, |
|
33 |
DATA |
|
34 |
}; |
|
35 |
||
36 |
class RelationConfiguration { |
|
37 |
public: |
|
38 |
||
39 |
RelationConfiguration() { |
|
40 |
} |
|
41 |
||
3
9f2d6645ebe6
use MODE::AUTO as default when no explicit configuration is present
František Kučera <franta-hg@frantovo.cz>
parents:
0
diff
changeset
|
42 |
RelationConfiguration(relpipe::common::type::StringX relation, MODE mode) : relation(relation), relationPattern(std::wregex(relation)), mode(mode) { |
9f2d6645ebe6
use MODE::AUTO as default when no explicit configuration is present
František Kučera <franta-hg@frantovo.cz>
parents:
0
diff
changeset
|
43 |
} |
9f2d6645ebe6
use MODE::AUTO as default when no explicit configuration is present
František Kučera <franta-hg@frantovo.cz>
parents:
0
diff
changeset
|
44 |
|
0 | 45 |
virtual ~RelationConfiguration() { |
46 |
} |
|
47 |
||
48 |
relpipe::common::type::StringX relation; |
|
49 |
std::wregex relationPattern; |
|
3
9f2d6645ebe6
use MODE::AUTO as default when no explicit configuration is present
František Kučera <franta-hg@frantovo.cz>
parents:
0
diff
changeset
|
50 |
MODE mode = MODE::AUTO; |
0 | 51 |
}; |
52 |
||
53 |
class Configuration { |
|
54 |
public: |
|
55 |
std::vector<RelationConfiguration> relationConfigurations; |
|
56 |
||
57 |
virtual ~Configuration() { |
|
58 |
} |
|
59 |
}; |
|
60 |
||
61 |
} |
|
62 |
} |
|
63 |
} |