src/Configuration.h
branchv_0
changeset 6 4062b8436838
child 11 9603e64324bc
equal deleted inserted replaced
5:17bb45570099 6:4062b8436838
       
     1 /**
       
     2  * Relational pipes
       
     3  * Copyright © 2019 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, either version 3 of the License, or
       
     8  * (at your option) any later version.
       
     9  *
       
    10  * This program is distributed in the hope that it will be useful,
       
    11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
       
    13  * GNU General Public License for more details.
       
    14  *
       
    15  * You should have received a copy of the GNU General Public License
       
    16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
       
    17  */
       
    18 #pragma once
       
    19 
       
    20 #include <vector>
       
    21 #include <tuple>
       
    22 
       
    23 #include <relpipe/writer/AttributeMetadata.h>
       
    24 #include <relpipe/writer/typedefs.h>
       
    25 
       
    26 namespace relpipe {
       
    27 namespace tr {
       
    28 namespace guile {
       
    29 
       
    30 class DefinitionRecipe {
       
    31 public:
       
    32 
       
    33 	virtual ~DefinitionRecipe() {
       
    34 	}
       
    35 
       
    36 	relpipe::writer::string_t name;
       
    37 	relpipe::writer::string_t type;
       
    38 	relpipe::writer::string_t value;
       
    39 };
       
    40 
       
    41 class RelationConfiguration {
       
    42 public:
       
    43 
       
    44 	virtual ~RelationConfiguration() {
       
    45 	}
       
    46 
       
    47 	relpipe::writer::string_t relation;
       
    48 	relpipe::writer::string_t guileBeforeRecords;
       
    49 	relpipe::writer::string_t guileAfterRecords;
       
    50 	relpipe::writer::string_t guileForEach;
       
    51 	relpipe::writer::string_t guileWhere;
       
    52 	/**
       
    53 	 * If true, Guile code will be executed, but no output will be generated.
       
    54 	 */
       
    55 	bool drop = false;
       
    56 	/**
       
    57 	 * 
       
    58 	 */
       
    59 	std::vector<DefinitionRecipe> definitions;
       
    60 	/**
       
    61 	 * If empty, output relation will have same metadata as the input relation.
       
    62 	 */
       
    63 	std::vector<relpipe::writer::AttributeMetadata> writerMetadata;
       
    64 };
       
    65 
       
    66 class Configuration {
       
    67 public:
       
    68 	vector<RelationConfiguration> relationConfigurations;
       
    69 
       
    70 	virtual ~Configuration() {
       
    71 	}
       
    72 };
       
    73 
       
    74 }
       
    75 }
       
    76 }