ARTS 2.5.11 (git: 725533f0)
methods_aux.cc File Reference

Auxiliary material for the workspace methods, which used to be in methods.cc. More...

#include <algorithm>
#include <map>
#include "arts.h"
#include "groups.h"
#include "methods.h"
#include "workspace_ng.h"
#include "workspace_global_data.h"
#include "wsv_aux.h"

Go to the source code of this file.

Namespaces

namespace  global_data
 

Functions

void limit_line_length (ostream &os, ostringstream &curline, ostringstream &token, const String &indent, size_t linelen)
 Limit length of output.
 
void expand_md_data_raw_to_md_data ()
 Expand supergeneric methods.
 
void define_md_map ()
 Define MdMap.
 
void define_md_raw_map ()
 Define MdRawMap.
 
bool format_paragraph (String &s, const String &indent, const size_t linelen, const size_t offset)
 
void get_short_wsv_description (String &s, const String &desc)
 
ostream & operator<< (ostream &os, const MdRecord &mdr)
 Output operator for MdRecord.
 

Detailed Description

Auxiliary material for the workspace methods, which used to be in methods.cc.

The reason for the separation is that the stuff here hardly ever should be changed, whereas methods.cc has to be edited each time a new method is added. See methods.h for more documentation.

Author
Stefan Buehler
Date
2000-06-10

Definition in file methods_aux.cc.

Function Documentation

◆ define_md_map()

void define_md_map ( )

Define MdMap.

MdMap can be used to find method data by method name.

Definition at line 476 of file methods_aux.cc.

References MdRecord::ActualGroups(), ARTS_ASSERT, DEBUG_ONLY, global_data::md_data, global_data::MdMap, MdRecord::Name(), Array< base >::nelem(), MdRecord::Supergeneric(), and global_data::wsv_groups.

Referenced by main().

◆ define_md_raw_map()

void define_md_raw_map ( )

Define MdRawMap.

MdRawMap can be used to find method data by method name. In the md_data_raw lookup table. This is the method table before expansion of supergeneric methods.

We add the _sg_Type string to the methodname here, so that supergeneric methods can be picked out for the right type.

Definition at line 512 of file methods_aux.cc.

References global_data::md_data_raw, and global_data::MdRawMap.

Referenced by main().

◆ expand_md_data_raw_to_md_data()

void expand_md_data_raw_to_md_data ( )

Expand supergeneric methods.

This creates md_data from md_data_raw, by explicitly expanding supergeneric methods for all groups. That means, e.g., instead of supergeneric method Copy(Any,Any) there will be Copy_sg_Vector(Vector,Vector), Copy_sg_Matrix(Matrix,Matrix), etc..

Not only the GOutType and GInType lists are manipulated, also the method name.

Definition at line 413 of file methods_aux.cc.

References ARTS_ASSERT, get_wsv_group_id(), MdRecord::GInSpecType(), MdRecord::GOutSpecType(), max(), global_data::md_data, global_data::md_data_raw, Array< base >::nelem(), MdRecord::subst_any_with_group(), MdRecord::subst_any_with_specific_group(), MdRecord::Supergeneric(), and global_data::wsv_groups.

Referenced by main(), and main().

◆ format_paragraph()

bool format_paragraph ( String s,
const String indent,
const size_t  linelen,
const size_t  offset 
)

Definition at line 521 of file methods_aux.cc.

◆ get_short_wsv_description()

void get_short_wsv_description ( String s,
const String desc 
)

Definition at line 555 of file methods_aux.cc.

References my_basic_string< char >::npos.

◆ limit_line_length()

void limit_line_length ( ostream &  os,
ostringstream &  curline,
ostringstream &  token,
const String indent,
size_t  linelen 
)

Limit length of output.

Automatically inserts linebreaks at certain length.

Author
Oliver Lemke
Date
2008-09-03

Definition at line 636 of file methods_aux.cc.

◆ operator<<()

ostream & operator<< ( ostream &  os,
const MdRecord mdr 
)

Output operator for MdRecord.

Definition at line 651 of file methods_aux.cc.