Agenda Class Reference

The Agenda class. More...

#include <agenda_class.h>

Collaboration diagram for Agenda:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 Agenda ()
 Agenda (const Agenda &x)
void append (Workspace &ws, const String &methodname, const TokVal &keywordvalue)
 Appends methods to an agenda.
void check (Workspace &ws)
 Checks consistency of an agenda.
void push_back (MRecord n)
 Append a new method to end of list.
void execute (Workspace &ws) const
 Execute an agenda.
void resize (Index n)
 Resize the method list.
Index nelem () const
 Return the number of agenda elements.
Agendaoperator= (const Agenda &x)
 Assignment operator.
const Array< MRecord > & Methods () const
void set_methods (const Array< MRecord > &ml)
void set_outputs_to_push_and_dup ()
 Retrieve indexes of all input and output WSVs.
bool is_input (Workspace &ws, Index var) const
 Check if given variable is agenda input.
bool is_output (Index var) const
 Check if given variable is agenda output.
void set_name (const String &nname)
 Set agenda name.
String name () const
 Agenda name.
const ArrayOfIndexget_output2push () const
const ArrayOfIndexget_output2dup () const
void print (ostream &os, const String &indent) const
 Print an agenda.
void set_main_agenda ()
bool is_main_agenda () const

Private Attributes

String mname
Array< MRecordmml
ArrayOfIndex moutput_push
ArrayOfIndex moutput_dup
bool main_agenda
 Is set to true if this is the main agenda.
bool mchecked
 Flag indicating that the agenda was checked for consistency.


Detailed Description

The Agenda class.

An agenda is a list of workspace methods (including keyword data) to be executed. There are workspace variables of class agenda that can contain a list of methods to execute for a particular purpose, for example to compute the lineshape in an absorption calculation.

Definition at line 43 of file agenda_class.h.


Constructor & Destructor Documentation

Agenda::Agenda (  )  [inline]

Definition at line 46 of file agenda_class.h.

Agenda::Agenda ( const Agenda x  )  [inline]

Copies an agenda.

Definition at line 53 of file agenda_class.h.


Member Function Documentation

void Agenda::append ( Workspace ws,
const String methodname,
const TokVal keywordvalue 
)

Appends methods to an agenda.

This function appends a workspace method to the agenda. It currently only supports appending WSMs which have no generic input or output, and which are defined as Set methods which take only one keyword.

The keyword value has to be a string, which for no value should be of length zero.

Parameters:
ws Workspace reference
methodname The name of the WSM
keywordvalue The value of the keyword
Author:
Mattias Ekstrom
Date:
2005-01-05

Definition at line 67 of file agenda_class.cc.

References AgendaAppend(), md_data, MdMap, mname, push_back(), and resize().

Referenced by jacobianAddAbsSpecies(), jacobianAddPointing(), jacobianAddPolyfit(), and jacobianAddTemperature().

void Agenda::check ( Workspace ws  ) 

Checks consistency of an agenda.

Checks that the input used by the agenda and the output produced by the actual methods corresponds to what is desired in the lookup data.

Definition at line 96 of file agenda_class.cc.

References agenda_data, AgendaMap, is_input(), is_output(), mchecked, mname, Array< base >::nelem(), set_outputs_to_push_and_dup(), and Workspace::wsv_data.

Referenced by AgendaAppend(), and AgendaSet().

void Agenda::push_back ( MRecord  n  )  [inline]

Append a new method to end of list.

This is used by the parser to fill up the agenda.

Parameters:
n New method to add.

Definition at line 253 of file agenda_class.h.

References mchecked, and mml.

Referenced by append(), ArtsParser::parse_agenda(), and ArtsParser::tasklist_insert_set_delete().

void Agenda::execute ( Workspace ws  )  const

void Agenda::resize ( Index  n  )  [inline]

Resize the method list.

Resizes the agenda's method list to n elements

Definition at line 229 of file agenda_class.h.

References mml.

Referenced by append(), MRecord::operator=(), and ArtsParser::parse_method().

Index Agenda::nelem (  )  const [inline]

Return the number of agenda elements.

This is needed, so that we can find out the correct size for resize, befor we do a copy.

Returns:
Number of agenda elements.

Definition at line 241 of file agenda_class.h.

References mml, and Array< base >::nelem().

Referenced by chk_not_empty(), is_input(), is_output(), jacobianCalc(), MRecord::operator=(), and ArtsParser::parse_agenda().

Agenda & Agenda::operator= ( const Agenda x  )  [inline]

Assignment operator.

Copies an agenda.

Definition at line 264 of file agenda_class.h.

References mchecked, mml, mname, moutput_dup, and moutput_push.

const Array<MRecord>& Agenda::Methods (  )  const [inline]

Definition at line 70 of file agenda_class.h.

References mml.

Referenced by AgendaAppend(), and ArtsParser::parse_agenda().

void Agenda::set_methods ( const Array< MRecord > &  ml  )  [inline]

Definition at line 71 of file agenda_class.h.

References mchecked, and mml.

Referenced by AgendaAppend().

void Agenda::set_outputs_to_push_and_dup (  ) 

Retrieve indexes of all input and output WSVs.

Builds arrays of WSM output variables which need to be duplicated or pushed on the WSV stack before the agenda is executed.

Definition at line 286 of file agenda_class.cc.

References agenda_data, AgendaMap, AgRecord::In(), md_data, mml, moutput_dup, moutput_push, name(), Array< base >::nelem(), AgRecord::Out(), out3, and PrintWsvNames().

Referenced by check().

bool Agenda::is_input ( Workspace ws,
Index  var 
) const

Check if given variable is agenda input.

A variable is agenda input if it is an input variable to any of the methods making up the agenda.

Parameters:
[in,out] ws Current Workspace
[in] var The workspace variable to check.
Returns:
True if var is an input variable of this agenda.

Definition at line 475 of file agenda_class.cc.

References MRecord::Id(), MRecord::In(), md_data, mml, nelem(), Array< base >::nelem(), and wsv_group_names.

Referenced by check().

bool Agenda::is_output ( Index  var  )  const

Check if given variable is agenda output.

A variable is agenda output if it is an output variable to any of the methods making up the agenda.

Parameters:
var The workspace variable to check.
Returns:
True if var is an output variable of this agenda.

Definition at line 551 of file agenda_class.cc.

References MRecord::Id(), md_data, mml, Array< base >::nelem(), nelem(), and MRecord::Out().

Referenced by check().

void Agenda::set_name ( const String nname  ) 

Set agenda name.

This sets the private member mname to the given string.

Parameters:
nname The name for the agenda.

Definition at line 595 of file agenda_class.cc.

References mchecked, and mname.

Referenced by AgendaSet(), cloudboxOff(), jacobianInit(), and main().

String Agenda::name (  )  const

const ArrayOfIndex& Agenda::get_output2push (  )  const [inline]

const ArrayOfIndex& Agenda::get_output2dup (  )  const [inline]

void Agenda::print ( ostream &  os,
const String indent 
) const

Print an agenda.

This prints an agenda, by printing the individual methods, just as they would appear in the controlfile.

Parameters:
os Output stream.
indent How many characters of indentation.
Author:
Stefan Buehler
Date:
2002-12-02

Definition at line 623 of file agenda_class.cc.

References mml, and Array< base >::nelem().

Referenced by operator<<(), and MRecord::print().

void Agenda::set_main_agenda (  )  [inline]

Definition at line 81 of file agenda_class.h.

References main_agenda, and mchecked.

Referenced by main().

bool Agenda::is_main_agenda (  )  const [inline]

Definition at line 82 of file agenda_class.h.

Referenced by execute().


Member Data Documentation

String Agenda::mname [private]

Agenda name.

Definition at line 82 of file agenda_class.h.

Referenced by append(), check(), execute(), name(), operator=(), and set_name().

The actual list of methods to execute.

Definition at line 85 of file agenda_class.h.

Referenced by execute(), is_input(), is_output(), Methods(), nelem(), operator=(), print(), push_back(), resize(), set_methods(), and set_outputs_to_push_and_dup().

Definition at line 87 of file agenda_class.h.

Referenced by get_output2push(), operator=(), and set_outputs_to_push_and_dup().

Definition at line 89 of file agenda_class.h.

Referenced by get_output2dup(), operator=(), and set_outputs_to_push_and_dup().

bool Agenda::main_agenda [private]

Is set to true if this is the main agenda.

Definition at line 92 of file agenda_class.h.

Referenced by set_main_agenda().

bool Agenda::mchecked [private]

Flag indicating that the agenda was checked for consistency.

Definition at line 95 of file agenda_class.h.

Referenced by check(), execute(), operator=(), push_back(), set_main_agenda(), set_methods(), and set_name().


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

Generated on Mon Mar 23 14:06:56 2009 for ARTS by  doxygen 1.5.6