ARTS
2.2.66
|
This is a little C++ program that generates the file auto_md.h from the workspace methods data md_data. More...
#include "arts.h"
#include "array.h"
#include "file.h"
#include "methods.h"
#include "workspace_ng.h"
#include "agenda_record.h"
#include "global_data.h"
Go to the source code of this file.
Functions | |
void | align (ofstream &ofs, bool &is_first_parameter, const String &indent) |
void | write_method_header_documentation (ofstream &ofs, const MdRecord &mdd) |
Write method header documentation. More... | |
void | write_method_header (ofstream &ofs, const MdRecord &mdd) |
Write a method header. More... | |
bool | md_sanity_checks (const Array< MdRecord > &md_data) |
int | main () |
This is a little C++ program that generates the file auto_md.h from the workspace methods data md_data.
The file auto_md.h declares the enum type MdHandle that is used to access the method data, so it has to be made sure that the two are allways consistent.
A second file is produced: auto_md.cc. This contains the `get-away' functions that provided the interface between the engine and the workspace methods. The get-functions all have the same arguments:
Their names all have the extension _g
Pointers to the get-away functions are stored in the array `getaway'.
Each get-away function simply contains a function call to the matching workspace method. The parameters are arranged similar to the follwing example:
First come the output workspace variables, then the input workspace variables, and then the control parameters. There can be an arbitrary number of parameters of each type, but the most usual case is to have only one output workspace variable.
The same variable may be both in the list of input and in the list of output workspace variables. This case makes good sense, actually, if you think for example of a method that adds an offset to the absorption coefficients. IN THAT CASE THE VARIABLE IS ADDED TO THE LIST ONLY ONCE, namely among the OUTPUT variables.
For generic methods the names of the actual workspace variables are also passed on to the method function.
Definition in file make_auto_md_h.cc.
void align | ( | ofstream & | ofs, |
bool & | is_first_parameter, | ||
const String & | indent | ||
) |
Definition at line 77 of file make_auto_md_h.cc.
Referenced by write_method_header(), and write_method_header_documentation().
int main | ( | void | ) |
Definition at line 602 of file make_auto_md_h.cc.
References MdRecord::ActualGroups(), global_data::agenda_data, define_agenda_data(), define_md_data_raw(), Workspace::define_wsv_data(), define_wsv_group_names(), Workspace::define_wsv_map(), expand_md_data_raw_to_md_data(), global_data::md_data, global_data::md_data_raw, md_sanity_checks(), MdRecord::Name(), open_output_file(), MdRecord::Supergeneric(), MdRecord::UsesTemplates(), write_agenda_wrapper_header(), write_method_header(), and write_method_header_documentation().
void write_method_header | ( | ofstream & | ofs, |
const MdRecord & | mdd | ||
) |
Write a method header.
ofs | The stream to write to. |
mdd | Method lookup data. |
Definition at line 273 of file make_auto_md_h.cc.
References MdRecord::AgendaMethod(), align(), get_wsv_group_id(), MdRecord::GIn(), MdRecord::GInType(), MdRecord::GOut(), MdRecord::GOutType(), MdRecord::In(), MdRecord::InOnly(), MdRecord::Name(), my_basic_string< charT >::nelem(), Array< base >::nelem(), MdRecord::Out(), MdRecord::PassWorkspace(), MdRecord::PassWsvNames(), MdRecord::Supergeneric(), MdRecord::UsesTemplates(), Workspace::wsv_data, and global_data::wsv_group_names.
Referenced by main().
void write_method_header_documentation | ( | ofstream & | ofs, |
const MdRecord & | mdd | ||
) |
Write method header documentation.
[in,out] | ofs | The stream to write to. |
mdd | Method lookup data. |
Definition at line 95 of file make_auto_md_h.cc.
References MdRecord::AgendaMethod(), align(), MdRecord::Authors(), MdRecord::Description(), get_wsv_group_id(), MdRecord::GIn(), MdRecord::GInDefault(), MdRecord::GInType(), MdRecord::GOut(), MdRecord::GOutType(), MdRecord::In(), MdRecord::InOnly(), my_basic_string< charT >::insert_substr(), MdRecord::Name(), Array< base >::nelem(), NODEF, MdRecord::Out(), MdRecord::PassWorkspace(), MdRecord::PassWsvNames(), MdRecord::Supergeneric(), and Workspace::wsv_data.
Referenced by main().