ARTS 2.5.9 (git: 825fa5f2)
methods.h
Go to the documentation of this file.
1/* Copyright (C) 2000-2012 Stefan Buehler <sbuehler@ltu.se>
2
3 This program is free software; you can redistribute it and/or modify it
4 under the terms of the GNU General Public License as published by the
5 Free Software Foundation; either version 2, or (at your option) any
6 later version.
7
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12
13 You should have received a copy of the GNU General Public License
14 along with this program; if not, write to the Free Software
15 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
16 USA. */
17
28#ifndef methods_h
29#define methods_h
30
31#include <iosfwd>
32#include "matpackI.h"
33#include "messages.h"
34
35#define NODEF "@@THIS_KEYWORD_HAS_NO_DEFAULT_VALUE@@"
36
38class MdRecord {
39 public:
42 : mname(""),
43 mdescription(""),
44 mauthors(0),
45 moutput(0),
46 mgout(0),
47 mgouttype(0),
48 mgoutdesc(0),
49 minput(0),
50 mgin(0),
51 mgintype(0),
52 mgindefault(0),
53 mgindesc(0),
54 mset_method(false),
55 magenda_method(false),
56 msupergeneric(false),
57 muses_templates(false),
58 mpass_workspace(true),
59 mpass_wsv_names(false),
60 mactual_groups("") {}
61
62 // Initializing constructor. Implementation in methods_aux.cc.
63 MdRecord(const char* name,
64 const char* description,
65 const ArrayOfString& authors,
66 const ArrayOfString& output,
67 const ArrayOfString& gout,
68 const ArrayOfString& gouttype,
69 const ArrayOfString& goutdesc,
70 const ArrayOfString& input,
71 const ArrayOfString& gin,
72 const ArrayOfString& gintype,
73 const ArrayOfString& gindefault,
74 const ArrayOfString& gindesc,
75 bool set_method = false,
76 bool agenda_method = false,
77 bool uses_templates = false,
78 bool pass_workspace = false,
79 bool pass_wsv_names = false);
80
81 MdRecord(const MdRecord&) = default;
82 MdRecord(MdRecord&&) = default;
83
84 // Methods returning the lookup information:
85 [[nodiscard]] const String& Name() const { return mname; }
86 [[nodiscard]] const String& Description() const { return mdescription; }
87 [[nodiscard]] const ArrayOfString& Authors() const { return mauthors; }
88 [[nodiscard]] const ArrayOfIndex& Out() const { return moutput; }
89 [[nodiscard]] const ArrayOfString& GOut() const { return mgout; }
90 [[nodiscard]] const ArrayOfIndex& GOutType() const { return mgouttype; }
91 [[nodiscard]] const ArrayOfArrayOfIndex& GOutSpecType() const { return mgoutspectype; }
92 [[nodiscard]] const Array<String>& GOutDescription() const { return mgoutdesc; }
93 [[nodiscard]] const ArrayOfIndex& In() const { return minput; }
94 [[nodiscard]] const ArrayOfString& GIn() const { return mgin; }
95 [[nodiscard]] const ArrayOfIndex& GInType() const { return mgintype; }
96 [[nodiscard]] const ArrayOfArrayOfIndex& GInSpecType() const { return mginspectype; }
97 [[nodiscard]] const Array<String>& GInDefault() const { return mgindefault; }
98 [[nodiscard]] const Array<String>& GInDescription() const { return mgindesc; }
99 [[nodiscard]] const ArrayOfIndex& InOnly() const { return minonly; }
100 [[nodiscard]] const ArrayOfIndex& InOut() const { return minout; }
101 [[nodiscard]] const ArrayOfIndex& OutOnly() const { return moutonly; }
102 [[nodiscard]] bool SetMethod() const { return mset_method; }
103 [[nodiscard]] bool AgendaMethod() const { return magenda_method; }
104 [[nodiscard]] bool Supergeneric() const { return msupergeneric; }
105 [[nodiscard]] bool UsesTemplates() const { return muses_templates; }
106 [[nodiscard]] bool PassWorkspace() const { return mpass_workspace; }
107 [[nodiscard]] bool PassWsvNames() const { return mpass_wsv_names; }
108 [[nodiscard]] const String& ActualGroups() const { return mactual_groups; }
110
111 // Expand supergeneric method record to an actual group
112 // (documentation with implementation in method_aux.cc):
115
117
126 ostream& PrintTemplate(ostream& os, bool show_description = true) const;
127
128 MdRecord& operator=(MdRecord&& m) = default;
129 MdRecord& operator=(const MdRecord& m) = default;
130
131 // Needed by make_auto_md_h.cc. See documentation there.
132 friend void subst_any_with_group(MdRecord& mdd, Index g);
133
134 friend ostream& operator<<(ostream& os, const MdRecord& mdr);
135
136 private:
139
142
145
148
151
154
156 // is not completely supergeneric but only defined for these types).
158
161
164
167
170
172 // is not completely supergeneric but only defined for these types).
174
177
180
183
186
189
191
196
198
203
205
210
212
217
219
224
226
232
234
238};
239
240void define_md_data_raw();
241
243
245 const String& indent,
246 const size_t linelen,
247 const size_t offset = 0);
248
249void define_md_map();
250
251void define_md_raw_map();
252
253void get_short_wsv_description(String& s, const String& desc);
254
255#endif // methods_h
All information for one workspace method.
Definition: methods.h:38
ArrayOfIndex mgouttype
Generic Workspace Output Type.
Definition: methods.h:153
ArrayOfArrayOfIndex mginspectype
Generic Workspace Input Types (Contains the valid types if the method.
Definition: methods.h:173
bool muses_templates
Flag, whether method implementation relies on templates.
Definition: methods.h:216
const ArrayOfIndex & In() const
Definition: methods.h:93
bool mpass_workspace
Flag, whether a workspace reference should be passed to the WSM.
Definition: methods.h:223
ArrayOfIndex moutput
Workspace Output.
Definition: methods.h:147
MdRecord(MdRecord &&)=default
String mactual_groups
The actual groups of a supergeneric method.
Definition: methods.h:237
const String & Name() const
Definition: methods.h:85
void subst_any_with_specific_group(Index g)
Expand supergeneric record for given Index in GOutSpecType and GInSpecType.
Definition: methods_aux.cc:366
const ArrayOfIndex & InOnly() const
Definition: methods.h:99
ArrayOfString mgindesc
Generic Workspace Input Description.
Definition: methods.h:179
bool PassWorkspace() const
Definition: methods.h:106
const ArrayOfIndex & GOutType() const
Definition: methods.h:90
const Array< String > & GOutDescription() const
Definition: methods.h:92
String mdescription
A text string describing this method.
Definition: methods.h:141
ArrayOfString mauthors
Author(s) of this method.
Definition: methods.h:144
const String & ActualGroups() const
Definition: methods.h:108
MdRecord & operator=(MdRecord &&m)=default
String mname
The name of this method.
Definition: methods.h:138
const Array< String > & GInDefault() const
Definition: methods.h:97
MdRecord()
Default constructor.
Definition: methods.h:41
bool PassWsvNames() const
Definition: methods.h:107
ArrayOfIndex minout
Indexes of Input-Output variables.
Definition: methods.h:188
const ArrayOfArrayOfIndex & GInSpecType() const
Definition: methods.h:96
ArrayOfString mgindefault
Generic Workspace Input Defaults.
Definition: methods.h:176
const String & Description() const
Definition: methods.h:86
const ArrayOfString & GOut() const
Definition: methods.h:89
ArrayOfIndex minput
Workspace Input.
Definition: methods.h:163
bool UsesTemplates() const
Definition: methods.h:105
bool mpass_wsv_names
Flag, whether WSV names should be passed to the WSM.
Definition: methods.h:231
friend ostream & operator<<(ostream &os, const MdRecord &mdr)
Output operator for MdRecord.
Definition: methods_aux.cc:650
bool AgendaMethod() const
Definition: methods.h:103
ArrayOfIndex mgintype
Generic Workspace Input.
Definition: methods.h:169
ArrayOfIndex moutonly
Indexes of Output-only variables.
Definition: methods.h:185
const Array< String > & GInDescription() const
Definition: methods.h:98
friend void subst_any_with_group(MdRecord &mdd, Index g)
ArrayOfIndex minonly
Indexes of Input-only variables.
Definition: methods.h:182
const ArrayOfIndex & InOut() const
Definition: methods.h:100
bool Supergeneric() const
Definition: methods.h:104
ostream & PrintTemplate(ostream &os, bool show_description=true) const
Print method template for the control file.
Definition: methods_aux.cc:574
const ArrayOfString & Authors() const
Definition: methods.h:87
bool mset_method
Flag, whether this is a set method.
Definition: methods.h:195
bool SetMethod() const
Definition: methods.h:102
ArrayOfString mgin
Generic Workspace Input Names.
Definition: methods.h:166
const ArrayOfArrayOfIndex & GOutSpecType() const
Definition: methods.h:91
const ArrayOfIndex & Out() const
Definition: methods.h:88
const ArrayOfIndex & GInType() const
Definition: methods.h:95
ArrayOfString mgout
Generic Workspace Output Names.
Definition: methods.h:150
MdRecord(const MdRecord &)=default
ArrayOfArrayOfIndex mgoutspectype
Generic Workspace Output Types (Contains the valid types if the method.
Definition: methods.h:157
const ArrayOfString & GIn() const
Definition: methods.h:94
void SetPassWorkspace()
Definition: methods.h:109
ArrayOfString mgoutdesc
Generic Workspace Output Description.
Definition: methods.h:160
MdRecord & operator=(const MdRecord &m)=default
bool magenda_method
Flag, whether this is an agenda method.
Definition: methods.h:202
const ArrayOfIndex & OutOnly() const
Definition: methods.h:101
bool msupergeneric
Flag, whether this method is supergeneric.
Definition: methods.h:209
Implementation of Matrix, Vector, and such stuff.
INDEX Index
The type to use for all integer numbers and indices.
Definition: matpack.h:39
Declarations having to do with the four output streams.
void define_md_raw_map()
Define MdRawMap.
Definition: methods_aux.cc:511
void define_md_data_raw()
Definition: methods.cc:190
void get_short_wsv_description(String &s, const String &desc)
Definition: methods_aux.cc:554
void define_md_map()
Define MdMap.
Definition: methods_aux.cc:475
void expand_md_data_raw_to_md_data()
Expand supergeneric methods.
Definition: methods_aux.cc:412
bool format_paragraph(String &s, const String &indent, const size_t linelen, const size_t offset=0)
Definition: methods_aux.cc:520