src/Configuration.h
branchv_0
changeset 33 e87c231afb77
parent 26 421608ecc12a
equal deleted inserted replaced
32:2354c9058fb6 33:e87c231afb77
    22 #include <relpipe/writer/AttributeMetadata.h>
    22 #include <relpipe/writer/AttributeMetadata.h>
    23 #include <relpipe/writer/typedefs.h>
    23 #include <relpipe/writer/typedefs.h>
    24 
    24 
    25 namespace relpipe {
    25 namespace relpipe {
    26 namespace tr {
    26 namespace tr {
    27 namespace guile {
    27 namespace scheme {
    28 
    28 
    29 class DefinitionRecipe {
    29 class DefinitionRecipe {
    30 public:
    30 public:
    31 
    31 
    32 	virtual ~DefinitionRecipe() {
    32 	virtual ~DefinitionRecipe() {
    42 
    42 
    43 	virtual ~RelationConfiguration() {
    43 	virtual ~RelationConfiguration() {
    44 	}
    44 	}
    45 
    45 
    46 	relpipe::writer::string_t relation;
    46 	relpipe::writer::string_t relation;
    47 	relpipe::writer::string_t guileBeforeRecords;
    47 	relpipe::writer::string_t schemeBeforeRecords;
    48 	relpipe::writer::string_t guileAfterRecords;
    48 	relpipe::writer::string_t schemeAfterRecords;
    49 	relpipe::writer::string_t guileForEach;
    49 	relpipe::writer::string_t schemeForEach;
    50 	relpipe::writer::string_t guileWhere;
    50 	relpipe::writer::string_t schemeWhere;
    51 	relpipe::writer::string_t guileHasMoreRecords;
    51 	relpipe::writer::string_t schemeHasMoreRecords;
    52 	
    52 	
    53 	/**
    53 	/**
    54 	 * If true, additional relation will be generated: mapping between relpipe attribute names and Guile variable names
    54 	 * If true, additional relation will be generated: mapping between relpipe attribute names and Scheme variable names
    55 	 */
    55 	 */
    56 	bool debugVariableMapping = false;
    56 	bool debugVariableMapping = false;
    57 
    57 
    58 	/**
    58 	/**
    59 	 * If true, Guile code will be executed, but no output will be generated.
    59 	 * If true, Scheme code will be executed, but no output will be generated.
    60 	 */
    60 	 */
    61 	bool drop = false;
    61 	bool drop = false;
    62 
    62 
    63 	/**
    63 	/**
    64 	 * Variable definitions for this relation.
    64 	 * Variable definitions for this relation.
    92 	 * Can be used as a safe way for passing parameters from the outside environment.
    92 	 * Can be used as a safe way for passing parameters from the outside environment.
    93 	 * See also RelationConfiguration::definitions
    93 	 * See also RelationConfiguration::definitions
    94 	 */
    94 	 */
    95 	std::vector<DefinitionRecipe> definitions;
    95 	std::vector<DefinitionRecipe> definitions;
    96 
    96 
    97 	// TODO: --create t2 3 a integer b boolean '…guile…' – allow creating new relations? Or allow calling startRelation() and attribute() from Guile?
    97 	// TODO: --create t2 3 a integer b boolean '…scheme…' – allow creating new relations? Or allow calling startRelation() and attribute() from Scheme?
    98 	// TODO: --has-more-relations '…guile…' – called after all relations … ?
    98 	// TODO: --has-more-relations '…scheme…' – called after all relations … ?
    99 	// TODO: --dynamic-output-attributes '…guile…' – used instead or together with --output-attribute
    99 	// TODO: --dynamic-output-attributes '…scheme…' – used instead or together with --output-attribute
   100 
   100 
   101 	virtual ~Configuration() {
   101 	virtual ~Configuration() {
   102 	}
   102 	}
   103 };
   103 };
   104 
   104