40 const char* description,
43 : mname(name), mdescription(description), moutput(0), minput(0) {
54 std::ostringstream os;
55 os <<
"Agenda *" <<
mname <<
"* not found in WSV data.";
56 throw std::runtime_error(os.str());
60 for (Index j = 0; j < output.
nelem(); ++j) {
63 " agenda fails.\nOutput #", j + 1,
" named ", output[j],
69 os <<
"Unknown output WSV " << output[j] <<
" in WSM " <<
mname;
70 throw runtime_error(os.str());
75 for (Index j = 0; j < input.
nelem(); ++j) {
78 " agenda fails.\nInput #", j + 1,
" named ", input[j],
80 minput[j] = wsv_ptr->second;
84 os <<
"Unknown input WSV " << input[j] <<
" in WSM " <<
mname;
85 throw runtime_error(os.str());
94 for (Index i = 0; i < agenda_data.nelem(); ++i) {
95 AgendaMap[agenda_data[i].Name()] = i;
119 for (i = 0; i < agenda_data.nelem(); ++i) {
174 os <<
"\n*-------------------------------------------------------------------*\n"
175 <<
"Workspace variable = " << agr.
Name()
176 <<
"\n---------------------------------------------------------------------\n"
179 <<
"\n---------------------------------------------------------------------\n";
181 os <<
"Group = Agenda\n";
186 for (Index i = 0; i < agr.
Out().nelem(); ++i) {
199 for (Index i = 0; i < agr.
In().nelem(); ++i) {
208 os <<
"\n*-------------------------------------------------------------------*\n";
220 bool is_agenda_array) {
224 ofs <<
"void " << agr.
Name() <<
"Execute(\n";
227 ofs <<
" // Workspace\n";
228 ofs <<
" Workspace& ws,\n";
231 ofs <<
" // Output\n";
240 ofs <<
" // Input\n";
243 auto it = ago.begin();
244 while (it != ago.end() && *it != j) it++;
246 if (it == ago.end()) {
253 if (group_name !=
"Index" && group_name !=
"Numeric") {
261 ofs <<
" // Wrapper Input\n";
262 if (is_agenda_array) {
263 ofs <<
" const ArrayOfAgenda& input_agenda_array)";
265 ofs <<
" const Agenda& input_agenda)";
ostream & operator<<(ostream &os, const AgRecord &agr)
Output operator for AgRecord.
bool check_agenda_data()
Check that agendas.cc and workspace.cc are consistent.
void write_agenda_wrapper_header(ofstream &ofs, const AgRecord &agr, bool is_agenda_array)
Write a agenda wrapper header.
Declarations for AgRecord, storing lookup information for one agenda.
Lookup information for one agenda.
const ArrayOfIndex & Out() const
ArrayOfIndex moutput
Workspace Output.
const ArrayOfIndex & In() const
AgRecord()
Default constructor.
ArrayOfIndex minput
Workspace Input.
const String & Description() const
String mname
The name of this agenda.
const String & Name() const
This can be used to make arrays out of anything.
Index nelem() const ARTS_NOEXCEPT
Helper macros for debugging.
#define ARTS_ASSERT(condition,...)
#define ARTS_USER_ERROR_IF(condition,...)
Index get_wsv_group_id(const String &name)
Returns the id of the given group.
Declarations having to do with the four output streams.
const ArrayOfGroupRecord wsv_groups
The names associated with Wsv groups as Strings.
Array< WsvRecord > wsv_data
std::map< String, Index > WsvMap
const Array< AgRecord > agenda_data
The lookup information for the agendas.
map< String, Index > AgendaMap
The map associated with agenda_data.
This file contains the Workspace class.
Auxiliary header stuff related to workspace variable groups.