ModuleDef.h
1 /*
2  * MoMEMta: a modular implementation of the Matrix Element Method
3  * Copyright (C) 2016 Universite catholique de Louvain (UCL), Belgium
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 
19 #pragma once
20 
21 #include <string>
22 #include <vector>
23 
24 namespace momemta {
25 
27 struct AttrDef {
28  std::string name;
29  std::string type;
30  std::string default_value;
35  bool global;
36  bool optional;
37 };
38 
40 struct ArgDef {
41  std::string name;
42  std::string default_value;
43  bool optional;
44  bool many;
45 
55  std::vector<AttrDef> nested_attributes;
56 };
57 
61 struct ModuleDef {
62  std::vector<AttrDef> attributes;
63  std::vector<ArgDef> inputs;
64  std::vector<ArgDef> outputs;
65 
66  std::string name;
67 
69  bool internal = false;
70 
72  bool sticky = false;
73 };
74 
75 using ModuleList = std::vector<ModuleDef>;
76 
77 }
Definition: Graph.h:21
bool optional
Only meaningful for inputs.
Definition: ModuleDef.h:43
Defines an input / output.
Definition: ModuleDef.h:40
Defines an attribute.
Definition: ModuleDef.h:27
std::string default_value
Only meaningful for inputs.
Definition: ModuleDef.h:42
std::vector< AttrDef > nested_attributes
Definition: ModuleDef.h:55
bool many
Only meaningful for inputs. If True, this input points to a list instead of a single value...
Definition: ModuleDef.h:44