Go to the documentation of this file.
76 void align(ofstream& ofs,
bool& is_first_parameter,
const String& indent)
79 if (is_first_parameter)
80 is_first_parameter =
false;
102 bool is_first_parameter =
true;
110 bool pass_workspace =
false;
123 for (
Index j = 0; !pass_workspace && j < mdd.
In().nelem(); j++)
127 pass_workspace =
true;
133 for (
Index j = 0; !pass_workspace && j < mdd.
GInType().nelem(); j++)
137 pass_workspace =
true;
142 ofs <<
"//! WORKSPACE METHOD: " << fullname <<
".\n";
147 size_t start_pos = 0;
149 while (start_pos != string::npos)
151 start_pos = DoxyDescription.find (
"\n ", start_pos);
152 if (start_pos && start_pos != string::npos
153 && DoxyDescription[start_pos]-1 !=
'\n')
155 DoxyDescription.insert (start_pos + 1,
"<br>");
165 ofs << DoxyDescription <<
"\n";
170 ofs << indent <<
"\\author " << mdd.
Authors ()[j] <<
"\n";
177 ofs << indent <<
"\\param[in,out] " <<
"ws Workspace\n";
183 ofs << indent <<
"\\param[out] "
184 << wsv_data[vo[j]].Name() <<
" WS Output\n";
190 ofs << indent <<
"\\param[out] ";
192 if (mdd.
GOut()[j].length())
193 ofs << mdd.
GOut()[j];
195 ofs <<
"genericoutput" << j+1;
197 if (mdd.
Supergeneric ()) ofs <<
" Supergeneric output\n";
198 else ofs <<
" Generic output\n";
206 ofs << indent <<
"\\param[in] ";
207 if (mdd.
GOut()[j].length())
208 ofs << mdd.
GOut()[j] <<
"_wsvname";
210 ofs <<
"genericoutput" << j+1 <<
"_wsvname";
212 ofs <<
" Generic Output Name" << endl;
219 ofs << indent <<
"\\param[in] "
220 << wsv_data[vi[j]].Name() <<
" WS Input\n";
226 ofs << indent <<
"\\param[in] ";
227 if (mdd.
GIn()[j] !=
"")
230 ofs <<
"genericinput" << j+1;
232 ofs <<
" Generic Input";
236 ofs <<
" (Default: \"" << mdd.
GInDefault()[j] <<
"\")";
246 ofs << indent <<
"\\param[in] ";
247 if (mdd.
GIn()[j].length())
248 ofs << mdd.
GIn()[j] <<
"_wsvname";
250 ofs <<
"genericinput" << j+1 <<
"_wsvname";
252 ofs <<
" Generic Input Name" << endl;
260 align(ofs,is_first_parameter,indent);
261 ofs << indent <<
"\\param[in] " <<
"input_agenda Agenda from controlfile\n";
290 bool is_first_parameter =
true;
298 bool pass_workspace =
false;
311 for (
Index j = 0; !pass_workspace && j < mdd.
In().nelem(); j++)
315 pass_workspace =
true;
321 for (
Index j = 0; !pass_workspace && j < mdd.
GInType().nelem(); j++)
325 pass_workspace =
true;
337 ofs <<
"template <typename T>" << endl;
341 ofs <<
"void " << fullname <<
"(";
345 ofs <<
"// Workspace reference:\n";
346 ofs << indent <<
"Workspace& ws";
347 is_first_parameter =
false;
353 bool is_first_of_these =
true;
358 align(ofs,is_first_parameter,indent);
361 if (is_first_of_these)
363 ofs <<
"// WS Output:\n";
365 is_first_of_these =
false;
376 bool is_first_of_these =
true;
381 align(ofs,is_first_parameter,indent);
384 if (is_first_of_these)
386 ofs <<
"// WS Generic Output:\n";
388 is_first_of_these =
false;
394 if (mdd.
GOut()[j].length()) ofs << mdd.
GOut()[j];
395 else ofs <<
"genericoutput" << j+1;
403 bool is_first_of_these =
true;
408 align(ofs,is_first_parameter,indent);
411 if (is_first_of_these)
413 ofs <<
"// WS Generic Output Names:\n";
415 is_first_of_these =
false;
418 ofs <<
"const String& ";
419 if (mdd.
GOut()[j].length())
420 ofs << mdd.
GOut()[j] <<
"_wsvname";
422 ofs <<
"genericoutput" << j+1 <<
"_wsvname";
429 bool is_first_of_these =
true;
434 align(ofs,is_first_parameter,indent);
437 if (is_first_of_these)
439 ofs <<
"// WS Input:\n";
441 is_first_of_these =
false;
453 bool is_first_of_these =
true;
458 align(ofs,is_first_parameter,indent);
461 if (is_first_of_these)
463 ofs <<
"// WS Generic Input:\n";
465 is_first_of_these =
false;
471 if (mdd.
GIn()[j].length()) ofs << mdd.
GIn()[j];
472 else ofs <<
"genericinput" << j+1;
477 if (mdd.
GIn()[j].length()) ofs << mdd.
GIn()[j];
478 else ofs <<
"genericinput" << j+1;
487 bool is_first_of_these =
true;
492 align(ofs,is_first_parameter,indent);
495 if (is_first_of_these)
497 ofs <<
"// WS Generic Input Names:\n";
499 is_first_of_these =
false;
502 ofs <<
"const String& ";
503 if (mdd.
GIn()[j].length())
504 ofs << mdd.
GIn()[j] <<
"_wsvname";
506 ofs <<
"genericinput" << j+1 <<
"_wsvname";
513 align(ofs,is_first_parameter,indent);
514 ofs <<
"// Agenda from controlfile:\n";
516 ofs <<
"const Agenda& input_agenda";
521 bool pass_verbosity =
true;
524 for (
Index j = 0; pass_verbosity && j < mdd.
In().nelem(); j++)
526 if (wsv_data[mdd.
In()[j]].Name() ==
"verbosity")
528 pass_verbosity =
false;
533 for (
Index j = 0; pass_verbosity && j < mdd.
Out().nelem(); j++)
535 if (wsv_data[mdd.
Out()[j]].Name() ==
"verbosity")
537 pass_verbosity =
false;
543 align(ofs,is_first_parameter,indent);
544 ofs <<
"// Verbosity object:\n";
546 ofs <<
"const Verbosity& verbosity";
561 bool invalid_author =
false;
562 for (ArrayOfString::const_iterator j = i->Authors ().begin ();
563 !invalid_author && j < i->Authors ().end (); ++j)
565 if (*j ==
"" || *j ==
"unknown")
566 invalid_author =
true;
571 os << i->Name () <<
": Missing or invalid author.\n";
577 os << i->Name () <<
": Empty description.\n";
581 os << i->Name () <<
": Missing newline at the end of description.\n";
585 os << i->Name () <<
": Extra newline at the end of description.\n";
593 cerr <<
"Error(s) found in workspace method documentation (check methods.cc):\n"
634 ofs <<
"// This file was generated automatically by make_auto_md_h.cc.\n";
635 ofs <<
"// DO NOT EDIT !\n";
636 ofs <<
"// Generated: "
638 << __TIME__ <<
"\n\n";
640 ofs <<
"#ifndef auto_md_h\n";
641 ofs <<
"#define auto_md_h\n\n";
643 ofs <<
"#include \"matpackI.h\"\n"
644 <<
"#include \"matpackII.h\"\n"
645 <<
"#include \"abs_species_tags.h\"\n"
646 <<
"#include \"gas_abs_lookup.h\"\n"
647 <<
"#include \"gridded_fields.h\"\n"
648 <<
"#include \"optproperties.h\"\n"
649 <<
"#include \"jacobian.h\"\n"
650 <<
"#include \"mc_antenna.h\"\n"
651 <<
"#include \"m_general.h\"\n"
652 <<
"#include \"parser.h\"\n"
653 <<
"#include \"workspace_ng.h\"\n"
656 ofs <<
"// This is only used for a consistency check. You can get the\n"
657 <<
"// number of WSMs from md_data.nelem().\n"
658 <<
"#define N_MD " << n_md <<
"\n\n";
672 ofs <<
"// Method function declarations:\n\n";
673 for (
Index i=0; i<n_md; ++i)
684 ofs <<
"// Supergeneric template function declarations:\n\n";
696 ofs <<
"// Get-away function declarations:\n\n";
697 for (
Index i=0; i<n_md; ++i)
702 ofs <<
"void " << mdd.
Name()
704 <<
"_g(Workspace& ws, const MRecord& mr);\n";
708 ofs <<
"void " << mdd.
Name()
709 <<
"_g(Workspace& ws, const MRecord& mr);\n";
729 ofs <<
"\n#endif // auto_md_h\n";
735 catch (runtime_error x)
737 cout <<
"Something went wrong. Message text:\n";
738 cout << x.what() <<
'\n';
Declarations for AgRecord, storing lookup information for one agenda.
const ArrayOfString & GOut() const
static Array< WsvRecord > wsv_data
bool Supergeneric() const
const ArrayOfIndex & GOutType() const
void define_agenda_data()
Array< MdRecord > md_data_raw
Lookup information for workspace methods.
const ArrayOfIndex & GInType() const
bool PassWsvNames() const
void write_method_header_documentation(ofstream &ofs, const MdRecord &mdd)
Write method header documentation.
bool md_sanity_checks(const Array< MdRecord > &md_data)
bool SuppressHeader() const
This file contains the definition of Array.
const String & ActualGroups() const
Array< AgRecord > agenda_data
void write_agenda_wrapper_header(ofstream &ofs, const AgRecord &agr)
Write a agenda wrapper header.
The implementation for String, the ARTS string class.
void write_method_header(ofstream &ofs, const MdRecord &mdd)
Write a method header.
void insert_substr(const my_basic_string< charT > &searchstr, const my_basic_string< charT > &insstr)
Insert string before all occurrences of the substring.
void align(ofstream &ofs, bool &is_first_parameter, const String &indent)
bool AgendaMethod() const
static void define_wsv_data()
ArrayOfString wsv_group_names
void expand_md_data_raw_to_md_data()
Expand supergeneric methods.
void define_wsv_group_names()
Define the array of workspace variable group names.
const String & Name() const
const ArrayOfIndex & In() const
const ArrayOfIndex & InOnly() const
void open_output_file(ofstream &file, const String &name)
Open a file for writing.
Index nelem() const
Number of elements.
const Array< String > & GInDefault() const
Array< MdRecord > md_data
Lookup information for workspace methods.
const ArrayOfString & GIn() const
This file contains the declaration and partly the implementation of the workspace class.
All information for one workspace method.
int check_newline(const String &s)
Checks if there is exactly one newline character at the end of the string.
This file contains basic functions to handle ASCII files.
INDEX Index
The type to use for all integer numbers and indices.
const ArrayOfIndex & Out() const
static void define_wsv_map()
Index get_wsv_group_id(const String &name)
const String & Description() const
bool PassWorkspace() const
Index nelem() const
Number of elements.
Declaration of the class MdRecord.
void define_md_data_raw()
const ArrayOfString & Authors() const
The global header file for ARTS.