ARTS 2.5.9 (git: 825fa5f2)
MdRecord Class Reference

All information for one workspace method. More...

#include <methods.h>

Public Member Functions

 MdRecord ()
 Default constructor. More...
 
 MdRecord (const char *name, const char *description, const ArrayOfString &authors, const ArrayOfString &output, const ArrayOfString &gout, const ArrayOfString &gouttype, const ArrayOfString &goutdesc, const ArrayOfString &input, const ArrayOfString &gin, const ArrayOfString &gintype, const ArrayOfString &gindefault, const ArrayOfString &gindesc, bool set_method=false, bool agenda_method=false, bool uses_templates=false, bool pass_workspace=false, bool pass_wsv_names=false)
 Initializing constructor for MdRecord. More...
 
 MdRecord (const MdRecord &)=default
 
 MdRecord (MdRecord &&)=default
 
const StringName () const
 
const StringDescription () const
 
const ArrayOfStringAuthors () const
 
const ArrayOfIndexOut () const
 
const ArrayOfStringGOut () const
 
const ArrayOfIndexGOutType () const
 
const ArrayOfArrayOfIndexGOutSpecType () const
 
const Array< String > & GOutDescription () const
 
const ArrayOfIndexIn () const
 
const ArrayOfStringGIn () const
 
const ArrayOfIndexGInType () const
 
const ArrayOfArrayOfIndexGInSpecType () const
 
const Array< String > & GInDefault () const
 
const Array< String > & GInDescription () const
 
const ArrayOfIndexInOnly () const
 
const ArrayOfIndexInOut () const
 
const ArrayOfIndexOutOnly () const
 
bool SetMethod () const
 
bool AgendaMethod () const
 
bool Supergeneric () const
 
bool UsesTemplates () const
 
bool PassWorkspace () const
 
bool PassWsvNames () const
 
const StringActualGroups () const
 
void SetPassWorkspace ()
 
void subst_any_with_group (Index g)
 Expand supergeneric record for given group. More...
 
void subst_any_with_specific_group (Index g)
 Expand supergeneric record for given Index in GOutSpecType and GInSpecType. More...
 
ostream & PrintTemplate (ostream &os, bool show_description=true) const
 Print method template for the control file. More...
 
MdRecordoperator= (MdRecord &&m)=default
 
MdRecordoperator= (const MdRecord &m)=default
 

Private Attributes

String mname
 The name of this method. More...
 
String mdescription
 A text string describing this method. More...
 
ArrayOfString mauthors
 Author(s) of this method. More...
 
ArrayOfIndex moutput
 Workspace Output. More...
 
ArrayOfString mgout
 Generic Workspace Output Names. More...
 
ArrayOfIndex mgouttype
 Generic Workspace Output Type. More...
 
ArrayOfArrayOfIndex mgoutspectype
 Generic Workspace Output Types (Contains the valid types if the method. More...
 
ArrayOfString mgoutdesc
 Generic Workspace Output Description. More...
 
ArrayOfIndex minput
 Workspace Input. More...
 
ArrayOfString mgin
 Generic Workspace Input Names. More...
 
ArrayOfIndex mgintype
 Generic Workspace Input. More...
 
ArrayOfArrayOfIndex mginspectype
 Generic Workspace Input Types (Contains the valid types if the method. More...
 
ArrayOfString mgindefault
 Generic Workspace Input Defaults. More...
 
ArrayOfString mgindesc
 Generic Workspace Input Description. More...
 
ArrayOfIndex minonly
 Indexes of Input-only variables. More...
 
ArrayOfIndex moutonly
 Indexes of Output-only variables. More...
 
ArrayOfIndex minout
 Indexes of Input-Output variables. More...
 
bool mset_method
 Flag, whether this is a set method. More...
 
bool magenda_method
 Flag, whether this is an agenda method. More...
 
bool msupergeneric
 Flag, whether this method is supergeneric. More...
 
bool muses_templates
 Flag, whether method implementation relies on templates. More...
 
bool mpass_workspace
 Flag, whether a workspace reference should be passed to the WSM. More...
 
bool mpass_wsv_names
 Flag, whether WSV names should be passed to the WSM. More...
 
String mactual_groups
 The actual groups of a supergeneric method. More...
 

Friends

void subst_any_with_group (MdRecord &mdd, Index g)
 
ostream & operator<< (ostream &os, const MdRecord &mdr)
 Output operator for MdRecord. More...
 

Detailed Description

All information for one workspace method.

Definition at line 38 of file methods.h.

Constructor & Destructor Documentation

◆ MdRecord() [1/4]

MdRecord::MdRecord ( )
inline

Default constructor.

Definition at line 41 of file methods.h.

◆ MdRecord() [2/4]

MdRecord::MdRecord ( const char *  name,
const char *  description,
const ArrayOfString authors,
const ArrayOfString output,
const ArrayOfString gout,
const ArrayOfString gouttype,
const ArrayOfString goutdesc,
const ArrayOfString input,
const ArrayOfString gin,
const ArrayOfString gintype,
const ArrayOfString gindefault,
const ArrayOfString gindesc,
bool  set_method = false,
bool  agenda_method = false,
bool  uses_templates = false,
bool  pass_workspace = false,
bool  pass_wsv_names = false 
)

Initializing constructor for MdRecord.

This is the only non-trivial constructor, which sets all the fields. The flag for supergenericity is not set directly, but inferred from the presence of Any_ in the generic input or output list.

Definition at line 69 of file methods_aux.cc.

References ARTS_ASSERT, get_wsv_group_id(), get_wsv_group_ids(), mgin, mgindefault, mginspectype, mgintype, mgout, mgoutspectype, mgouttype, minonly, minout, minput, mname, moutonly, moutput, msupergeneric, muses_templates, Array< base >::nelem(), and global_data::WsvMap.

◆ MdRecord() [3/4]

MdRecord::MdRecord ( const MdRecord )
default

◆ MdRecord() [4/4]

MdRecord::MdRecord ( MdRecord &&  )
default

Member Function Documentation

◆ ActualGroups()

const String & MdRecord::ActualGroups ( ) const
inline

Definition at line 108 of file methods.h.

References mactual_groups.

Referenced by define_md_map(), and main().

◆ AgendaMethod()

bool MdRecord::AgendaMethod ( ) const
inline

◆ Authors()

const ArrayOfString & MdRecord::Authors ( ) const
inline

Definition at line 87 of file methods.h.

References mauthors.

Referenced by write_method_header_documentation().

◆ Description()

const String & MdRecord::Description ( ) const
inline

Definition at line 86 of file methods.h.

References mdescription.

Referenced by write_method_header_documentation().

◆ GIn()

◆ GInDefault()

const Array< String > & MdRecord::GInDefault ( ) const
inline

◆ GInDescription()

const Array< String > & MdRecord::GInDescription ( ) const
inline

Definition at line 98 of file methods.h.

References mgindesc.

◆ GInSpecType()

const ArrayOfArrayOfIndex & MdRecord::GInSpecType ( ) const
inline

Definition at line 96 of file methods.h.

References mginspectype.

Referenced by expand_md_data_raw_to_md_data(), option_input(), and ArtsParser::parse_generic_input().

◆ GInType()

◆ GOut()

const ArrayOfString & MdRecord::GOut ( ) const
inline

◆ GOutDescription()

const Array< String > & MdRecord::GOutDescription ( ) const
inline

Definition at line 92 of file methods.h.

References mgoutdesc.

◆ GOutSpecType()

const ArrayOfArrayOfIndex & MdRecord::GOutSpecType ( ) const
inline

◆ GOutType()

const ArrayOfIndex & MdRecord::GOutType ( ) const
inline

◆ In()

const ArrayOfIndex & MdRecord::In ( ) const
inline

◆ InOnly()

const ArrayOfIndex & MdRecord::InOnly ( ) const
inline

◆ InOut()

const ArrayOfIndex & MdRecord::InOut ( ) const
inline

Definition at line 100 of file methods.h.

References minout.

Referenced by Agenda::execute().

◆ Name()

◆ operator=() [1/2]

MdRecord & MdRecord::operator= ( const MdRecord m)
default

◆ operator=() [2/2]

MdRecord & MdRecord::operator= ( MdRecord &&  m)
default

◆ Out()

◆ OutOnly()

const ArrayOfIndex & MdRecord::OutOnly ( ) const
inline

Definition at line 101 of file methods.h.

References moutonly.

◆ PassWorkspace()

bool MdRecord::PassWorkspace ( ) const
inline

Definition at line 106 of file methods.h.

References mpass_workspace.

Referenced by main(), write_method_header(), and write_method_header_documentation().

◆ PassWsvNames()

bool MdRecord::PassWsvNames ( ) const
inline

Definition at line 107 of file methods.h.

References mpass_wsv_names.

Referenced by main(), write_method_header(), and write_method_header_documentation().

◆ PrintTemplate()

ostream & MdRecord::PrintTemplate ( ostream &  os,
bool  show_description = true 
) const

Print method template for the control file.

This prints the method data exactly in the same way how it can be included in the control file. The description string is also printed as a comment, but this can be turned off by setting show_comment to false.

Parameters
osOutput stream
show_descriptionShould the description string also be printed?

Definition at line 574 of file methods_aux.cc.

References GIn(), GInType(), GOutType(), Name(), Array< base >::nelem(), and global_data::wsv_groups.

◆ SetMethod()

bool MdRecord::SetMethod ( ) const
inline

Definition at line 102 of file methods.h.

References mset_method.

Referenced by Agenda::execute(), main(), and ArtsParser::parse_generic_input().

◆ SetPassWorkspace()

void MdRecord::SetPassWorkspace ( )
inline

Definition at line 109 of file methods.h.

References mpass_workspace.

◆ subst_any_with_group()

void MdRecord::subst_any_with_group ( Index  g)

Expand supergeneric record for given group.

This function will substitute any occurance of Any_ in the GOutType and GInType list of MdRecord by group g.

It also adds the group to the name like this: Copy becomes Copy_sg_Vector, Copy_sg_Matrix, etc..

Parameters
gThe group for which to expand.

Definition at line 323 of file methods_aux.cc.

References ARTS_ASSERT, get_wsv_group_id(), mactual_groups, mgintype, mgouttype, Array< base >::nelem(), Supergeneric(), and global_data::wsv_groups.

Referenced by expand_md_data_raw_to_md_data().

◆ subst_any_with_specific_group()

void MdRecord::subst_any_with_specific_group ( Index  g)

Expand supergeneric record for given Index in GOutSpecType and GInSpecType.

This function will substitute any occurance of Any_ in the GOutType and GInType list of MdRecord by group GOutSpecType[g] and GInSpecType[g].

It also adds the group to the name like this: Copy becomes Copy_sg_Vector, Copy_sg_Matrix, etc..

Parameters
gThe SpecType index for which to expand.

Definition at line 366 of file methods_aux.cc.

References ARTS_ASSERT, get_wsv_group_id(), mactual_groups, mginspectype, mgintype, mgoutspectype, mgouttype, Array< base >::nelem(), Supergeneric(), and global_data::wsv_groups.

Referenced by expand_md_data_raw_to_md_data().

◆ Supergeneric()

◆ UsesTemplates()

bool MdRecord::UsesTemplates ( ) const
inline

Definition at line 105 of file methods.h.

References muses_templates.

Referenced by main(), and write_method_header().

Friends And Related Function Documentation

◆ operator<<

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

Output operator for MdRecord.

Definition at line 650 of file methods_aux.cc.

◆ subst_any_with_group

void subst_any_with_group ( MdRecord mdd,
Index  g 
)
friend

Member Data Documentation

◆ mactual_groups

String MdRecord::mactual_groups
private

The actual groups of a supergeneric method.

This holds the actual groups after expansion of a supergeneric method.

Definition at line 237 of file methods.h.

Referenced by ActualGroups(), subst_any_with_group(), and subst_any_with_specific_group().

◆ magenda_method

bool MdRecord::magenda_method
private

Flag, whether this is an agenda method.

Agenda methods expect other method definitions inside their body in the controlfile.

Definition at line 202 of file methods.h.

Referenced by AgendaMethod().

◆ mauthors

ArrayOfString MdRecord::mauthors
private

Author(s) of this method.

Definition at line 144 of file methods.h.

Referenced by Authors().

◆ mdescription

String MdRecord::mdescription
private

A text string describing this method.

Definition at line 141 of file methods.h.

Referenced by Description().

◆ mgin

ArrayOfString MdRecord::mgin
private

Generic Workspace Input Names.

Definition at line 166 of file methods.h.

Referenced by GIn(), and MdRecord().

◆ mgindefault

ArrayOfString MdRecord::mgindefault
private

Generic Workspace Input Defaults.

Definition at line 176 of file methods.h.

Referenced by GInDefault(), and MdRecord().

◆ mgindesc

ArrayOfString MdRecord::mgindesc
private

Generic Workspace Input Description.

Definition at line 179 of file methods.h.

Referenced by GInDescription().

◆ mginspectype

ArrayOfArrayOfIndex MdRecord::mginspectype
private

Generic Workspace Input Types (Contains the valid types if the method.

Definition at line 173 of file methods.h.

Referenced by GInSpecType(), MdRecord(), and subst_any_with_specific_group().

◆ mgintype

ArrayOfIndex MdRecord::mgintype
private

Generic Workspace Input.

Definition at line 169 of file methods.h.

Referenced by GInType(), MdRecord(), subst_any_with_group(), and subst_any_with_specific_group().

◆ mgout

ArrayOfString MdRecord::mgout
private

Generic Workspace Output Names.

Definition at line 150 of file methods.h.

Referenced by GOut(), and MdRecord().

◆ mgoutdesc

ArrayOfString MdRecord::mgoutdesc
private

Generic Workspace Output Description.

Definition at line 160 of file methods.h.

Referenced by GOutDescription().

◆ mgoutspectype

ArrayOfArrayOfIndex MdRecord::mgoutspectype
private

Generic Workspace Output Types (Contains the valid types if the method.

Definition at line 157 of file methods.h.

Referenced by GOutSpecType(), MdRecord(), and subst_any_with_specific_group().

◆ mgouttype

ArrayOfIndex MdRecord::mgouttype
private

Generic Workspace Output Type.

Definition at line 153 of file methods.h.

Referenced by GOutType(), MdRecord(), subst_any_with_group(), and subst_any_with_specific_group().

◆ minonly

ArrayOfIndex MdRecord::minonly
private

Indexes of Input-only variables.

Definition at line 182 of file methods.h.

Referenced by InOnly(), and MdRecord().

◆ minout

ArrayOfIndex MdRecord::minout
private

Indexes of Input-Output variables.

Definition at line 188 of file methods.h.

Referenced by InOut(), and MdRecord().

◆ minput

ArrayOfIndex MdRecord::minput
private

Workspace Input.

Definition at line 163 of file methods.h.

Referenced by In(), and MdRecord().

◆ mname

String MdRecord::mname
private

The name of this method.

Definition at line 138 of file methods.h.

Referenced by MdRecord(), and Name().

◆ moutonly

ArrayOfIndex MdRecord::moutonly
private

Indexes of Output-only variables.

Definition at line 185 of file methods.h.

Referenced by MdRecord(), and OutOnly().

◆ moutput

ArrayOfIndex MdRecord::moutput
private

Workspace Output.

Definition at line 147 of file methods.h.

Referenced by MdRecord(), and Out().

◆ mpass_workspace

bool MdRecord::mpass_workspace
private

Flag, whether a workspace reference should be passed to the WSM.

Some WSMs (like Delete) need direct access to the workspace object. If this flag is set to true, the gateway function will take care of that.

Definition at line 223 of file methods.h.

Referenced by PassWorkspace(), and SetPassWorkspace().

◆ mpass_wsv_names

bool MdRecord::mpass_wsv_names
private

Flag, whether WSV names should be passed to the WSM.

Some WSMs (like ReadXML, WriteXML) need to know the names of the WSVs that have been passed to them. If this flag is set to true, the gateway function will take care of that.

Definition at line 231 of file methods.h.

Referenced by PassWsvNames().

◆ mset_method

bool MdRecord::mset_method
private

Flag, whether this is a set method.

Set methods have exactly one generic input. Unlike other inputs these are not stored in a workspace variable.

Definition at line 195 of file methods.h.

Referenced by SetMethod().

◆ msupergeneric

bool MdRecord::msupergeneric
private

Flag, whether this method is supergeneric.

This flag is set automatically if the gouttype or gintype contains Any_.

Definition at line 209 of file methods.h.

Referenced by MdRecord(), and Supergeneric().

◆ muses_templates

bool MdRecord::muses_templates
private

Flag, whether method implementation relies on templates.

If we want to implement a supergeneric method by a template function, we must not generate explicit method headers in auto_md.h.

Definition at line 216 of file methods.h.

Referenced by MdRecord(), and UsesTemplates().


The documentation for this class was generated from the following files: