OpenM++ runtime library (libopenm)
modelBuilder.h
Go to the documentation of this file.
1
5// Copyright (c) 2013-2015 OpenM++
6// This code is licensed under the MIT license (see LICENSE.txt for details)
7
8#ifndef OM_MODEL_BUILDER_H
9#define OM_MODEL_BUILDER_H
10
11#include <list>
12#include "dbMetaRow.h"
13#include "metaModelHolder.h"
14#include "metaSetHolder.h"
15
16using namespace std;
17
18namespace openm
19{
22 {
23 public:
24 virtual ~IModelBuilder() noexcept = 0;
25
27 static IModelBuilder * create(const string & i_providerNames, const string & i_sqlDir, const string & i_outputDir, const string & i_sqliteDir);
28
30 virtual bool isSqliteDb(void) const = 0;
31
33 virtual void setModelMetaRows(MetaModelHolder & io_metaRows) const = 0;
34
36 virtual void build(MetaModelHolder & io_metaRows) = 0;
37
39 virtual void beginWorkset(const MetaModelHolder & i_metaRows, MetaSetLangHolder & io_metaSet) = 0;
40
42 virtual void addWorksetParameter(
43 const MetaModelHolder & i_metaRows, const MetaSetLangHolder & i_metaSet, const string & i_name, int i_subId, const string & i_value
44 ) = 0;
45
47 virtual void addWorksetParameter(
48 const MetaModelHolder & i_metaRows, const MetaSetLangHolder & i_metaSet, const string & i_name, int i_subId, const list<string> & i_valueLst
49 ) = 0;
50
52 virtual void endWorkset(const MetaModelHolder & i_metaRows, const MetaSetLangHolder & i_metaSet) = 0;
53
55 virtual void buildCompatibilityViews(const MetaModelHolder & i_metaRows) const = 0;
56 };
57}
58
59#endif // OM_MODEL_BUILDER_H
OpenM++ data library: db rows of model metadata tables.
OpenM++ modeling library: holder struct for model metadata.
OpenM++ modeling library: holder struct for working sets metadata.
openM++ namespace
Definition: log.h:32
public interface to build model creation script from metadata rows.
Definition: modelBuilder.h:22
virtual void setModelMetaRows(MetaModelHolder &io_metaRows) const =0
set meta rows values and calculate digests for types, parameters, tables and model
virtual bool isSqliteDb(void) const =0
if true then create SQLite database
virtual void endWorkset(const MetaModelHolder &i_metaRows, const MetaSetLangHolder &i_metaSet)=0
finish sql script to create new working set
virtual void beginWorkset(const MetaModelHolder &i_metaRows, MetaSetLangHolder &io_metaSet)=0
start sql script to create new working set
virtual void addWorksetParameter(const MetaModelHolder &i_metaRows, const MetaSetLangHolder &i_metaSet, const string &i_name, int i_subId, const string &i_value)=0
append scalar parameter value to sql script for new working set creation
virtual void build(MetaModelHolder &io_metaRows)=0
update metadata and write sql script to create new model from supplied metadata rows
virtual void addWorksetParameter(const MetaModelHolder &i_metaRows, const MetaSetLangHolder &i_metaSet, const string &i_name, int i_subId, const list< string > &i_valueLst)=0
append parameter values to sql script for new working set creation
virtual void buildCompatibilityViews(const MetaModelHolder &i_metaRows) const =0
write sql script to create backward compatibility views
static IModelBuilder * create(const string &i_providerNames, const string &i_sqlDir, const string &i_outputDir, const string &i_sqliteDir)
new model builder to create sql script specific to each db-provider.
Definition: modelSqlBuilder.cpp:10
Holder for model metadata db rows.
Definition: metaModelHolder.h:19
Holder for working sets metadata.
Definition: metaSetHolder.h:30