ARTS 2.5.11 (git: 725533f0)
methods.h
Go to the documentation of this file.
1
11#ifndef methods_h
12#define methods_h
13
14#include <iosfwd>
15#include "matpack_data.h"
16#include "messages.h"
17
18#define NODEF "@@THIS_KEYWORD_HAS_NO_DEFAULT_VALUE@@"
19
21class MdRecord {
22 public:
25 : mname(""),
26 mdescription(""),
27 mauthors(0),
28 moutput(0),
29 mgout(0),
30 mgouttype(0),
31 mgoutdesc(0),
32 minput(0),
33 mgin(0),
34 mgintype(0),
35 mgindefault(0),
36 mgindesc(0),
37 mset_method(false),
38 magenda_method(false),
39 msupergeneric(false),
40 muses_templates(false),
41 mpass_workspace(true),
42 mpass_wsv_names(false),
43 mactual_groups("") {}
44
45 // Initializing constructor. Implementation in methods_aux.cc.
46 MdRecord(const char* name,
47 const char* description,
48 const ArrayOfString& authors,
49 const ArrayOfString& output,
50 const ArrayOfString& gout,
51 const ArrayOfString& gouttype,
52 const ArrayOfString& goutdesc,
53 const ArrayOfString& input,
54 const ArrayOfString& gin,
55 const ArrayOfString& gintype,
56 const ArrayOfString& gindefault,
57 const ArrayOfString& gindesc,
58 bool set_method = false,
59 bool agenda_method = false,
60 bool uses_templates = false,
61 bool pass_workspace = false,
62 bool pass_wsv_names = false);
63
64 MdRecord(const MdRecord&) = default;
65 MdRecord(MdRecord&&) = default;
66
67 // Methods returning the lookup information:
68 [[nodiscard]] const String& Name() const { return mname; }
69 [[nodiscard]] const String& Description() const { return mdescription; }
70 [[nodiscard]] const ArrayOfString& Authors() const { return mauthors; }
71 [[nodiscard]] const ArrayOfIndex& Out() const { return moutput; }
72 [[nodiscard]] const ArrayOfString& GOut() const { return mgout; }
73 [[nodiscard]] const ArrayOfIndex& GOutType() const { return mgouttype; }
74 [[nodiscard]] const ArrayOfArrayOfIndex& GOutSpecType() const { return mgoutspectype; }
75 [[nodiscard]] const Array<String>& GOutDescription() const { return mgoutdesc; }
76 [[nodiscard]] const ArrayOfIndex& In() const { return minput; }
77 [[nodiscard]] const ArrayOfString& GIn() const { return mgin; }
78 [[nodiscard]] const ArrayOfIndex& GInType() const { return mgintype; }
79 [[nodiscard]] const ArrayOfArrayOfIndex& GInSpecType() const { return mginspectype; }
80 [[nodiscard]] const Array<String>& GInDefault() const { return mgindefault; }
81 [[nodiscard]] const Array<String>& GInDescription() const { return mgindesc; }
82 [[nodiscard]] const ArrayOfIndex& InOnly() const { return minonly; }
83 [[nodiscard]] const ArrayOfIndex& InOut() const { return minout; }
84 [[nodiscard]] const ArrayOfIndex& OutOnly() const { return moutonly; }
85 [[nodiscard]] bool SetMethod() const { return mset_method; }
86 [[nodiscard]] bool AgendaMethod() const { return magenda_method; }
87 [[nodiscard]] bool Supergeneric() const { return msupergeneric; }
88 [[nodiscard]] bool UsesTemplates() const { return muses_templates; }
89 [[nodiscard]] bool PassWorkspace() const { return mpass_workspace; }
90 [[nodiscard]] bool PassWsvNames() const { return mpass_wsv_names; }
91 [[nodiscard]] const String& ActualGroups() const { return mactual_groups; }
93
94 // Expand supergeneric method record to an actual group
95 // (documentation with implementation in method_aux.cc):
96 void subst_any_with_group(Index g);
98
100
109 ostream& PrintTemplate(ostream& os, bool show_description = true) const;
110
111 MdRecord& operator=(MdRecord&& m) = default;
112 MdRecord& operator=(const MdRecord& m) = default;
113
114 // Needed by make_auto_md_h.cc. See documentation there.
115 friend void subst_any_with_group(MdRecord& mdd, Index g);
116
117 friend ostream& operator<<(ostream& os, const MdRecord& mdr);
118
119 private:
122
125
128
131
134
137
139 // is not completely supergeneric but only defined for these types).
141
144
147
150
153
155 // is not completely supergeneric but only defined for these types).
157
160
163
166
169
172
174
179
181
186
188
193
195
200
202
207
209
215
217
221};
222
223void define_md_data_raw();
224
226
228 const String& indent,
229 const size_t linelen,
230 const size_t offset = 0);
231
232void define_md_map();
233
234void define_md_raw_map();
235
236void get_short_wsv_description(String& s, const String& desc);
237
238#endif // methods_h
All information for one workspace method.
Definition methods.h:21
ArrayOfIndex mgouttype
Generic Workspace Output Type.
Definition methods.h:136
ArrayOfArrayOfIndex mginspectype
Generic Workspace Input Types (Contains the valid types if the method.
Definition methods.h:156
bool muses_templates
Flag, whether method implementation relies on templates.
Definition methods.h:199
const ArrayOfIndex & In() const
Definition methods.h:76
bool mpass_workspace
Flag, whether a workspace reference should be passed to the WSM.
Definition methods.h:206
ArrayOfIndex moutput
Workspace Output.
Definition methods.h:130
MdRecord(MdRecord &&)=default
String mactual_groups
The actual groups of a supergeneric method.
Definition methods.h:220
const String & Name() const
Definition methods.h:68
void subst_any_with_specific_group(Index g)
Expand supergeneric record for given Index in GOutSpecType and GInSpecType.
const ArrayOfIndex & InOnly() const
Definition methods.h:82
ArrayOfString mgindesc
Generic Workspace Input Description.
Definition methods.h:162
bool PassWorkspace() const
Definition methods.h:89
const ArrayOfIndex & GOutType() const
Definition methods.h:73
const Array< String > & GOutDescription() const
Definition methods.h:75
String mdescription
A text string describing this method.
Definition methods.h:124
ArrayOfString mauthors
Author(s) of this method.
Definition methods.h:127
const String & ActualGroups() const
Definition methods.h:91
MdRecord & operator=(MdRecord &&m)=default
String mname
The name of this method.
Definition methods.h:121
const Array< String > & GInDefault() const
Definition methods.h:80
MdRecord()
Default constructor.
Definition methods.h:24
bool PassWsvNames() const
Definition methods.h:90
ArrayOfIndex minout
Indexes of Input-Output variables.
Definition methods.h:171
const ArrayOfArrayOfIndex & GInSpecType() const
Definition methods.h:79
ArrayOfString mgindefault
Generic Workspace Input Defaults.
Definition methods.h:159
const String & Description() const
Definition methods.h:69
const ArrayOfString & GOut() const
Definition methods.h:72
ArrayOfIndex minput
Workspace Input.
Definition methods.h:146
bool UsesTemplates() const
Definition methods.h:88
bool mpass_wsv_names
Flag, whether WSV names should be passed to the WSM.
Definition methods.h:214
friend ostream & operator<<(ostream &os, const MdRecord &mdr)
Output operator for MdRecord.
bool AgendaMethod() const
Definition methods.h:86
ArrayOfIndex mgintype
Generic Workspace Input.
Definition methods.h:152
ArrayOfIndex moutonly
Indexes of Output-only variables.
Definition methods.h:168
const Array< String > & GInDescription() const
Definition methods.h:81
friend void subst_any_with_group(MdRecord &mdd, Index g)
ArrayOfIndex minonly
Indexes of Input-only variables.
Definition methods.h:165
const ArrayOfIndex & InOut() const
Definition methods.h:83
bool Supergeneric() const
Definition methods.h:87
ostream & PrintTemplate(ostream &os, bool show_description=true) const
Print method template for the control file.
const ArrayOfString & Authors() const
Definition methods.h:70
bool mset_method
Flag, whether this is a set method.
Definition methods.h:178
bool SetMethod() const
Definition methods.h:85
ArrayOfString mgin
Generic Workspace Input Names.
Definition methods.h:149
const ArrayOfArrayOfIndex & GOutSpecType() const
Definition methods.h:74
const ArrayOfIndex & Out() const
Definition methods.h:71
const ArrayOfIndex & GInType() const
Definition methods.h:78
ArrayOfString mgout
Generic Workspace Output Names.
Definition methods.h:133
MdRecord(const MdRecord &)=default
ArrayOfArrayOfIndex mgoutspectype
Generic Workspace Output Types (Contains the valid types if the method.
Definition methods.h:140
const ArrayOfString & GIn() const
Definition methods.h:77
void SetPassWorkspace()
Definition methods.h:92
ArrayOfString mgoutdesc
Generic Workspace Output Description.
Definition methods.h:143
MdRecord & operator=(const MdRecord &m)=default
bool magenda_method
Flag, whether this is an agenda method.
Definition methods.h:185
const ArrayOfIndex & OutOnly() const
Definition methods.h:84
bool msupergeneric
Flag, whether this method is supergeneric.
Definition methods.h:192
Declarations having to do with the four output streams.
void define_md_raw_map()
Define MdRawMap.
void define_md_data_raw()
Definition methods.cc:170
void get_short_wsv_description(String &s, const String &desc)
void define_md_map()
Define MdMap.
void expand_md_data_raw_to_md_data()
Expand supergeneric methods.
bool format_paragraph(String &s, const String &indent, const size_t linelen, const size_t offset=0)