ARTS  2.0.49
Workspace Class Reference

Workspace class. More...

#include <workspace_ng.h>

Classes

struct  WsvStruct
 

Public Member Functions

 Workspace ()
 Construct a new workspace. More...
 
 Workspace (const Workspace &workspace)
 Workspace copy constructor. More...
 
virtual ~Workspace ()
 Destruct the workspace. More...
 
void del (Index i)
 Delete WSV. More...
 
void duplicate (Index i)
 Duplicate WSV. More...
 
void initialize ()
 
bool is_initialized (Index i)
 Checks existence of the given WSV. More...
 
void * pop (Index i)
 Pop the topmost wsv from its stack. More...
 
void pop_free (Index i)
 Pop the topmost wsv from its stack and free its memory. More...
 
void push (Index i, void *wsv)
 Push a new wsv onto its stack. More...
 
void push_uninitialized (Index i, void *wsv)
 Push a new wsv onto its stack but mark it as uninitialized. More...
 
Index nelem ()
 
void * operator[] (Index i)
 Retrieve pointer to the given WSV. More...
 

Static Public Member Functions

static void define_wsv_data ()
 
static void define_wsv_map ()
 
static Index add_wsv (const WsvRecord &wsv)
 

Static Public Attributes

static Array< WsvRecordwsv_data
 
static map< String, IndexWsvMap
 

Private Attributes

Array< stack< WsvStruct * > > ws
 Workspace variable container. More...
 

Detailed Description

Workspace class.

Manages the workspace variables.

Definition at line 47 of file workspace_ng.h.

Constructor & Destructor Documentation

◆ Workspace() [1/2]

Workspace::Workspace ( )

Construct a new workspace.

Create the stacks for the WSVs.

Definition at line 45 of file workspace_ng.cc.

◆ Workspace() [2/2]

Workspace::Workspace ( const Workspace workspace)

Workspace copy constructor.

Make a copy of a workspace. The copy constructor will only copy the topmost layer of the workspace variable stacks.

Parameters
[in]workspaceThe workspace to be copied
Author
Oliver Lemke
Date
2007-11-28

Definition at line 128 of file workspace_ng.cc.

References Workspace::WsvStruct::auto_allocated, Workspace::WsvStruct::initialized, ws, and Workspace::WsvStruct::wsv.

◆ ~Workspace()

Workspace::~Workspace ( )
virtual

Destruct the workspace.

Frees all WSVs.

Definition at line 153 of file workspace_ng.cc.

References Workspace::WsvStruct::auto_allocated, WorkspaceMemoryHandler::deallocate(), ws, wsmh, Workspace::WsvStruct::wsv, and wsv_data.

Member Function Documentation

◆ add_wsv()

◆ define_wsv_data()

void Workspace::define_wsv_data ( )
static

Definition at line 50 of file workspace.cc.

References DESCRIPTION, GROUP, NAME, and wsv_data.

Referenced by main().

◆ define_wsv_map()

void Workspace::define_wsv_map ( )
static

Definition at line 50 of file workspace_ng.cc.

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

Referenced by add_wsv(), and main().

◆ del()

void Workspace::del ( Index  i)

Delete WSV.

Frees the memory of the topmost WSV on the stack.

Parameters
iWSV index.

Definition at line 73 of file workspace_ng.cc.

References Workspace::WsvStruct::auto_allocated, WorkspaceMemoryHandler::deallocate(), Workspace::WsvStruct::initialized, ws, wsmh, Workspace::WsvStruct::wsv, and wsv_data.

Referenced by Delete().

◆ duplicate()

◆ initialize()

void Workspace::initialize ( )

Definition at line 112 of file workspace_ng.cc.

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

Referenced by main(), and option_methods().

◆ is_initialized()

bool Workspace::is_initialized ( Index  i)
inline

Checks existence of the given WSV.

Definition at line 79 of file workspace_ng.h.

References ws.

Referenced by Agenda::execute(), and PrintWorkspace().

◆ nelem()

Index Workspace::nelem ( )
inline

Definition at line 91 of file workspace_ng.h.

References ws.

Referenced by PrintWorkspace().

◆ operator[]()

void * Workspace::operator[] ( Index  i)

Retrieve pointer to the given WSV.

This method returns a void pointer to the topmost instance of the given workspace variable.

Parameters
iWSV index.

Definition at line 259 of file workspace_ng.cc.

References WorkspaceMemoryHandler::allocate(), push(), ws, wsmh, and wsv_data.

◆ pop()

◆ pop_free()

◆ push()

◆ push_uninitialized()

void Workspace::push_uninitialized ( Index  i,
void *  wsv 
)

Push a new wsv onto its stack but mark it as uninitialized.

Adds the pointer to the variable to the stack of the WSV with index i. The variable is flagged as uninitialized. This is used for agenda output-only variables.

Parameters
iWSV index.
wsvVoid pointer to variable that should be put on the stack.

Definition at line 242 of file workspace_ng.cc.

References Workspace::WsvStruct::auto_allocated, Workspace::WsvStruct::initialized, ws, and Workspace::WsvStruct::wsv.

Referenced by abs_scalar_gas_agendaExecute(), doit_mono_agendaExecute(), emission_agendaExecute(), iy_clearsky_agendaExecute(), iy_clearsky_basic_agendaExecute(), iy_cloudbox_agendaExecute(), iy_space_agendaExecute(), jacobian_y_agendaExecute(), met_profile_calc_agendaExecute(), refr_index_agendaExecute(), sensor_response_agendaExecute(), surface_prop_agendaExecute(), and ybatch_calc_agendaExecute().

Member Data Documentation

◆ ws

Array< stack<WsvStruct *> > Workspace::ws
private

◆ wsv_data

Array< WsvRecord > Workspace::wsv_data
static

Definition at line 59 of file workspace_ng.h.

Referenced by add_wsv(), AgendaAppend_g(), AgendaSet_g(), Agenda::check(), check_agenda_data(), define_wsv_data(), define_wsv_map(), del(), Delete_sg_Agenda_g(), Delete_sg_ArrayOfArrayOfGriddedField1_g(), Delete_sg_ArrayOfArrayOfGriddedField3_g(), Delete_sg_ArrayOfArrayOfIndex_g(), Delete_sg_ArrayOfArrayOfLineRecord_g(), Delete_sg_ArrayOfArrayOfMatrix_g(), Delete_sg_ArrayOfArrayOfSpeciesTag_g(), Delete_sg_ArrayOfArrayOfTensor3_g(), Delete_sg_ArrayOfArrayOfTensor6_g(), Delete_sg_ArrayOfGriddedField1_g(), Delete_sg_ArrayOfGriddedField2_g(), Delete_sg_ArrayOfGriddedField3_g(), Delete_sg_ArrayOfGriddedField4_g(), Delete_sg_ArrayOfIndex_g(), Delete_sg_ArrayOfLineRecord_g(), Delete_sg_ArrayOfLineshapeSpec_g(), Delete_sg_ArrayOfMatrix_g(), Delete_sg_ArrayOfRetrievalQuantity_g(), Delete_sg_ArrayOfScatteringMetaData_g(), Delete_sg_ArrayOfSingleScatteringData_g(), Delete_sg_ArrayOfSparse_g(), Delete_sg_ArrayOfString_g(), Delete_sg_ArrayOfTensor3_g(), Delete_sg_ArrayOfTensor4_g(), Delete_sg_ArrayOfTensor6_g(), Delete_sg_ArrayOfTensor7_g(), Delete_sg_ArrayOfVector_g(), Delete_sg_GasAbsLookup_g(), Delete_sg_GriddedField1_g(), Delete_sg_GriddedField2_g(), Delete_sg_GriddedField3_g(), Delete_sg_GriddedField4_g(), Delete_sg_GridPos_g(), Delete_sg_Index_g(), Delete_sg_Matrix_g(), Delete_sg_MCAntenna_g(), Delete_sg_Numeric_g(), Delete_sg_Ppath_g(), Delete_sg_ScatteringMetaData_g(), Delete_sg_SingleScatteringData_g(), Delete_sg_Sparse_g(), Delete_sg_String_g(), Delete_sg_Tensor3_g(), Delete_sg_Tensor4_g(), Delete_sg_Tensor5_g(), Delete_sg_Tensor6_g(), Delete_sg_Tensor7_g(), Delete_sg_Timer_g(), Delete_sg_Vector_g(), Delete_sg_Verbosity_g(), duplicate(), Agenda::execute(), initialize(), main(), operator<<(), operator[](), option_describe(), option_input(), option_methods(), option_workspacevariables(), ArtsParser::parse_agenda(), ArtsParser::parse_generic_input(), ArtsParser::parse_generic_output(), ArtsParser::parse_specific_input(), ArtsParser::parse_specific_output(), pop_free(), MRecord::print(), PrintWsvName(), ReadNetCDF_sg_ArrayOfMatrix_g(), ReadNetCDF_sg_ArrayOfVector_g(), ReadNetCDF_sg_Matrix_g(), ReadNetCDF_sg_Tensor3_g(), ReadNetCDF_sg_Tensor4_g(), ReadNetCDF_sg_Tensor5_g(), ReadNetCDF_sg_Vector_g(), ReadXML_sg_Agenda_g(), ReadXML_sg_ArrayOfArrayOfGriddedField1_g(), ReadXML_sg_ArrayOfArrayOfGriddedField3_g(), ReadXML_sg_ArrayOfArrayOfIndex_g(), ReadXML_sg_ArrayOfArrayOfLineRecord_g(), ReadXML_sg_ArrayOfArrayOfMatrix_g(), ReadXML_sg_ArrayOfArrayOfSpeciesTag_g(), ReadXML_sg_ArrayOfArrayOfTensor3_g(), ReadXML_sg_ArrayOfArrayOfTensor6_g(), ReadXML_sg_ArrayOfGriddedField1_g(), ReadXML_sg_ArrayOfGriddedField2_g(), ReadXML_sg_ArrayOfGriddedField3_g(), ReadXML_sg_ArrayOfGriddedField4_g(), ReadXML_sg_ArrayOfIndex_g(), ReadXML_sg_ArrayOfLineRecord_g(), ReadXML_sg_ArrayOfLineshapeSpec_g(), ReadXML_sg_ArrayOfMatrix_g(), ReadXML_sg_ArrayOfRetrievalQuantity_g(), ReadXML_sg_ArrayOfScatteringMetaData_g(), ReadXML_sg_ArrayOfSingleScatteringData_g(), ReadXML_sg_ArrayOfSparse_g(), ReadXML_sg_ArrayOfString_g(), ReadXML_sg_ArrayOfTensor3_g(), ReadXML_sg_ArrayOfTensor4_g(), ReadXML_sg_ArrayOfTensor6_g(), ReadXML_sg_ArrayOfTensor7_g(), ReadXML_sg_ArrayOfVector_g(), ReadXML_sg_GasAbsLookup_g(), ReadXML_sg_GriddedField1_g(), ReadXML_sg_GriddedField2_g(), ReadXML_sg_GriddedField3_g(), ReadXML_sg_GriddedField4_g(), ReadXML_sg_GridPos_g(), ReadXML_sg_Index_g(), ReadXML_sg_Matrix_g(), ReadXML_sg_MCAntenna_g(), ReadXML_sg_Numeric_g(), ReadXML_sg_Ppath_g(), ReadXML_sg_ScatteringMetaData_g(), ReadXML_sg_SingleScatteringData_g(), ReadXML_sg_Sparse_g(), ReadXML_sg_String_g(), ReadXML_sg_Tensor3_g(), ReadXML_sg_Tensor4_g(), ReadXML_sg_Tensor5_g(), ReadXML_sg_Tensor6_g(), ReadXML_sg_Tensor7_g(), ReadXML_sg_Timer_g(), ReadXML_sg_Vector_g(), ReadXML_sg_Verbosity_g(), ArtsParser::tasklist_insert_set_delete(), write_agenda_wrapper_header(), write_method_header(), write_method_header_documentation(), WriteNetCDF_sg_ArrayOfMatrix_g(), WriteNetCDF_sg_ArrayOfVector_g(), WriteNetCDF_sg_Matrix_g(), WriteNetCDF_sg_Tensor3_g(), WriteNetCDF_sg_Tensor4_g(), WriteNetCDF_sg_Tensor5_g(), WriteNetCDF_sg_Vector_g(), WriteXML_sg_Agenda_g(), WriteXML_sg_ArrayOfArrayOfGriddedField1_g(), WriteXML_sg_ArrayOfArrayOfGriddedField3_g(), WriteXML_sg_ArrayOfArrayOfIndex_g(), WriteXML_sg_ArrayOfArrayOfLineRecord_g(), WriteXML_sg_ArrayOfArrayOfMatrix_g(), WriteXML_sg_ArrayOfArrayOfSpeciesTag_g(), WriteXML_sg_ArrayOfArrayOfTensor3_g(), WriteXML_sg_ArrayOfArrayOfTensor6_g(), WriteXML_sg_ArrayOfGriddedField1_g(), WriteXML_sg_ArrayOfGriddedField2_g(), WriteXML_sg_ArrayOfGriddedField3_g(), WriteXML_sg_ArrayOfGriddedField4_g(), WriteXML_sg_ArrayOfIndex_g(), WriteXML_sg_ArrayOfLineRecord_g(), WriteXML_sg_ArrayOfLineshapeSpec_g(), WriteXML_sg_ArrayOfMatrix_g(), WriteXML_sg_ArrayOfRetrievalQuantity_g(), WriteXML_sg_ArrayOfScatteringMetaData_g(), WriteXML_sg_ArrayOfSingleScatteringData_g(), WriteXML_sg_ArrayOfSparse_g(), WriteXML_sg_ArrayOfString_g(), WriteXML_sg_ArrayOfTensor3_g(), WriteXML_sg_ArrayOfTensor4_g(), WriteXML_sg_ArrayOfTensor6_g(), WriteXML_sg_ArrayOfTensor7_g(), WriteXML_sg_ArrayOfVector_g(), WriteXML_sg_GasAbsLookup_g(), WriteXML_sg_GriddedField1_g(), WriteXML_sg_GriddedField2_g(), WriteXML_sg_GriddedField3_g(), WriteXML_sg_GriddedField4_g(), WriteXML_sg_GridPos_g(), WriteXML_sg_Index_g(), WriteXML_sg_Matrix_g(), WriteXML_sg_MCAntenna_g(), WriteXML_sg_Numeric_g(), WriteXML_sg_Ppath_g(), WriteXML_sg_ScatteringMetaData_g(), WriteXML_sg_SingleScatteringData_g(), WriteXML_sg_Sparse_g(), WriteXML_sg_String_g(), WriteXML_sg_Tensor3_g(), WriteXML_sg_Tensor4_g(), WriteXML_sg_Tensor5_g(), WriteXML_sg_Tensor6_g(), WriteXML_sg_Tensor7_g(), WriteXML_sg_Timer_g(), WriteXML_sg_Vector_g(), WriteXML_sg_Verbosity_g(), WriteXMLIndexed_sg_Agenda_g(), WriteXMLIndexed_sg_ArrayOfArrayOfGriddedField1_g(), WriteXMLIndexed_sg_ArrayOfArrayOfGriddedField3_g(), WriteXMLIndexed_sg_ArrayOfArrayOfIndex_g(), WriteXMLIndexed_sg_ArrayOfArrayOfLineRecord_g(), WriteXMLIndexed_sg_ArrayOfArrayOfMatrix_g(), WriteXMLIndexed_sg_ArrayOfArrayOfSpeciesTag_g(), WriteXMLIndexed_sg_ArrayOfArrayOfTensor3_g(), WriteXMLIndexed_sg_ArrayOfArrayOfTensor6_g(), WriteXMLIndexed_sg_ArrayOfGriddedField1_g(), WriteXMLIndexed_sg_ArrayOfGriddedField2_g(), WriteXMLIndexed_sg_ArrayOfGriddedField3_g(), WriteXMLIndexed_sg_ArrayOfGriddedField4_g(), WriteXMLIndexed_sg_ArrayOfIndex_g(), WriteXMLIndexed_sg_ArrayOfLineRecord_g(), WriteXMLIndexed_sg_ArrayOfLineshapeSpec_g(), WriteXMLIndexed_sg_ArrayOfMatrix_g(), WriteXMLIndexed_sg_ArrayOfRetrievalQuantity_g(), WriteXMLIndexed_sg_ArrayOfScatteringMetaData_g(), WriteXMLIndexed_sg_ArrayOfSingleScatteringData_g(), WriteXMLIndexed_sg_ArrayOfSparse_g(), WriteXMLIndexed_sg_ArrayOfString_g(), WriteXMLIndexed_sg_ArrayOfTensor3_g(), WriteXMLIndexed_sg_ArrayOfTensor4_g(), WriteXMLIndexed_sg_ArrayOfTensor6_g(), WriteXMLIndexed_sg_ArrayOfTensor7_g(), WriteXMLIndexed_sg_ArrayOfVector_g(), WriteXMLIndexed_sg_GasAbsLookup_g(), WriteXMLIndexed_sg_GriddedField1_g(), WriteXMLIndexed_sg_GriddedField2_g(), WriteXMLIndexed_sg_GriddedField3_g(), WriteXMLIndexed_sg_GriddedField4_g(), WriteXMLIndexed_sg_GridPos_g(), WriteXMLIndexed_sg_Index_g(), WriteXMLIndexed_sg_Matrix_g(), WriteXMLIndexed_sg_MCAntenna_g(), WriteXMLIndexed_sg_Numeric_g(), WriteXMLIndexed_sg_Ppath_g(), WriteXMLIndexed_sg_ScatteringMetaData_g(), WriteXMLIndexed_sg_SingleScatteringData_g(), WriteXMLIndexed_sg_Sparse_g(), WriteXMLIndexed_sg_String_g(), WriteXMLIndexed_sg_Tensor3_g(), WriteXMLIndexed_sg_Tensor4_g(), WriteXMLIndexed_sg_Tensor5_g(), WriteXMLIndexed_sg_Tensor6_g(), WriteXMLIndexed_sg_Tensor7_g(), WriteXMLIndexed_sg_Timer_g(), WriteXMLIndexed_sg_Vector_g(), WriteXMLIndexed_sg_Verbosity_g(), and ~Workspace().

◆ WsvMap


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