ARTS  2.0.49
make_auto_md_h.cc File Reference

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"

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 ()
 

Detailed Description

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:

void get_away_example_g(Workspace& ws,
const MRecord& mr);

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:

void SomeMethod(owsv1,iwsv1,iwsv2,iwsv3,c1,c2,c3,...)

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.

Author
Stefan Buehler
Date
2000-07-29

Definition in file make_auto_md_h.cc.

Function Documentation

◆ align()

void align ( ofstream &  ofs,
bool &  is_first_parameter,
const String indent 
)

Definition at line 76 of file make_auto_md_h.cc.

Referenced by write_method_header(), and write_method_header_documentation().

◆ main()

◆ md_sanity_checks()

bool md_sanity_checks ( const Array< MdRecord > &  md_data)

Definition at line 553 of file make_auto_md_h.cc.

References check_newline(), and md_data.

Referenced by main().

◆ write_method_header()

◆ write_method_header_documentation()

MRecord
Method runtime data.
Definition: agenda_class.h:112
Workspace
Workspace class.
Definition: workspace_ng.h:47