src/Configuration.h
author František Kučera <franta-hg@frantovo.cz>
Sat, 20 Mar 2021 19:18:10 +0100
branchv_0
changeset 0 3493d6e7016e
child 1 3bbf848b3565
permissions -rw-r--r--
project skeleton
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
3493d6e7016e project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     1
/**
3493d6e7016e project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     2
 * Relational pipes
3493d6e7016e project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     3
 * Copyright © 2021 František Kučera (Frantovo.cz, GlobalCode.info)
3493d6e7016e project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     4
 *
3493d6e7016e project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     5
 * This program is free software: you can redistribute it and/or modify
3493d6e7016e project skeleton
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
3493d6e7016e project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     7
 * the Free Software Foundation, version 3 of the License.
3493d6e7016e project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     8
 *
3493d6e7016e project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
3493d6e7016e project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
3493d6e7016e project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3493d6e7016e project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    12
 * GNU General Public License for more details.
3493d6e7016e project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    13
 *
3493d6e7016e project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    14
 * You should have received a copy of the GNU General Public License
3493d6e7016e project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    15
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
3493d6e7016e project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    16
 */
3493d6e7016e project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    17
#pragma once
3493d6e7016e project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    18
3493d6e7016e project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    19
#include <vector>
3493d6e7016e project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    20
#include <iostream>
3493d6e7016e project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    21
3493d6e7016e project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    22
#include <relpipe/common/type/typedefs.h>
3493d6e7016e project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    23
3493d6e7016e project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    24
3493d6e7016e project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    25
namespace relpipe {
3493d6e7016e project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    26
namespace in {
3493d6e7016e project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    27
namespace x11 {
3493d6e7016e project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    28
3493d6e7016e project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    29
class AttributeRecipe {
3493d6e7016e project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    30
public:
3493d6e7016e project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    31
3493d6e7016e project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    32
	virtual ~AttributeRecipe() {
3493d6e7016e project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    33
	}
3493d6e7016e project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    34
3493d6e7016e project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    35
	relpipe::common::type::StringX name;
3493d6e7016e project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    36
	relpipe::writer::TypeId type;
3493d6e7016e project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    37
3493d6e7016e project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    38
};
3493d6e7016e project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    39
3493d6e7016e project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    40
class RelationConfiguration {
3493d6e7016e project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    41
public:
3493d6e7016e project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    42
3493d6e7016e project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    43
	virtual ~RelationConfiguration() {
3493d6e7016e project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    44
	}
3493d6e7016e project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    45
3493d6e7016e project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    46
	relpipe::common::type::StringX relation;
3493d6e7016e project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    47
	relpipe::common::type::Boolean writeHeader = true;
3493d6e7016e project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    48
	std::vector<AttributeRecipe> attributes;
3493d6e7016e project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    49
	std::vector<relpipe::common::type::StringX> values;
3493d6e7016e project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    50
	std::istream* valueStream = nullptr;
3493d6e7016e project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    51
};
3493d6e7016e project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    52
3493d6e7016e project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    53
class Configuration {
3493d6e7016e project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    54
public:
3493d6e7016e project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    55
	std::vector<RelationConfiguration> relationConfigurations;
3493d6e7016e project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    56
3493d6e7016e project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    57
	virtual ~Configuration() {
3493d6e7016e project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    58
	}
3493d6e7016e project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    59
};
3493d6e7016e project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    60
3493d6e7016e project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    61
}
3493d6e7016e project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    62
}
3493d6e7016e project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    63
}