ARTS 2.5.11 (git: 725533f0)
m_basic_types.h File Reference

Functions for straightforward operations on variables of basic types. More...

#include <sstream>
#include "agenda_class.h"
#include "array.h"
#include "arts.h"
#include "exceptions.h"
#include "gridded_fields.h"
#include "matpack_data.h"
#include "matpack_concepts.h"
#include "messages.h"
#include "mystring.h"
#include "workspace_ng.h"

Go to the source code of this file.

Macros

#define TMPL_NGET_GENERIC(what)
 
#define TMPL_NGET_AGENDA(what)
 
#define NGET_GENERIC(what, type)
 
#define SET_TO_LAST_GENERIC(type)
 

Functions

template<typename T >
void IndexSetToLast (Index &n, const T &x, const Verbosity &)
 WORKSPACE METHOD: IndexSetToLast.
 
void nelemGet (Workspace &, Index &nelem, const ArrayOfAgenda &x, const Verbosity &)
 
void IndexSetToLast (Workspace &, Index &nelem, const ArrayOfAgenda &x, const Verbosity &)
 

Detailed Description

Functions for straightforward operations on variables of basic types.

Author
Oliver Lemke olemk.nosp@m.e@co.nosp@m.re-du.nosp@m.mp.i.nosp@m.nfo
Date
2004-09-20

Definition in file m_basic_types.h.

Macro Definition Documentation

◆ NGET_GENERIC

#define NGET_GENERIC (   what,
  type 
)
Value:
inline void what##Get(Index& what, const type& x, const Verbosity&) { \
what = x.what(); \
}

Definition at line 90 of file m_basic_types.h.

◆ SET_TO_LAST_GENERIC

#define SET_TO_LAST_GENERIC (   type)
Value:
inline void IndexSetToLast(Index& i, const type& x, const Verbosity&) { \
i = x.nelem() - 1; \
}
void IndexSetToLast(Index &n, const T &x, const Verbosity &)
WORKSPACE METHOD: IndexSetToLast.

Definition at line 95 of file m_basic_types.h.

◆ TMPL_NGET_AGENDA

#define TMPL_NGET_AGENDA (   what)
Value:
inline void what##Get(Workspace& ws _U_, Index&, const Agenda&, const Verbosity&) { \
ostringstream os; \
os << "The variable has no such attribute.\n"; \
throw runtime_error(os.str()); \
}
The Agenda class.
Workspace class.
#define _U_
Definition config.h:177

Definition at line 58 of file m_basic_types.h.

◆ TMPL_NGET_GENERIC

#define TMPL_NGET_GENERIC (   what)
Value:
template <typename T> \
void what##Get(Index& n, const T& x, const Verbosity&) { \
if constexpr (matpack::has_##what<T>) \
n = x.what(); \
else \
ARTS_USER_ERROR("The variable has no " #what " attribute.\n") \
}

Definition at line 37 of file m_basic_types.h.

Function Documentation

◆ IndexSetToLast() [1/2]

template<typename T >
void IndexSetToLast ( Index &  nelem,
const T &  v,
const Verbosity verbosity 
)

WORKSPACE METHOD: IndexSetToLast.

Set an Index to point towards last position of array-type variables.

This method works as nelemGet, but gives the index number of the last element (which equals nelem-1).

Author
Patrick Eriksson
Oliver Lemke
Parameters
[out]nelemWS Output
[in]vGeneric Input

Definition at line 78 of file m_basic_types.h.

References ARTS_USER_ERROR.

Referenced by IndexSetToLast_sg_ArrayOfAbsorptionLines_g(), IndexSetToLast_sg_ArrayOfAgenda_g(), IndexSetToLast_sg_ArrayOfArrayOfAbsorptionLines_g(), IndexSetToLast_sg_ArrayOfArrayOfGriddedField1_g(), IndexSetToLast_sg_ArrayOfArrayOfGriddedField2_g(), IndexSetToLast_sg_ArrayOfArrayOfGriddedField3_g(), IndexSetToLast_sg_ArrayOfArrayOfIndex_g(), IndexSetToLast_sg_ArrayOfArrayOfMatrix_g(), IndexSetToLast_sg_ArrayOfArrayOfPropagationMatrix_g(), IndexSetToLast_sg_ArrayOfArrayOfRadiationVector_g(), IndexSetToLast_sg_ArrayOfArrayOfScatteringMetaData_g(), IndexSetToLast_sg_ArrayOfArrayOfSingleScatteringData_g(), IndexSetToLast_sg_ArrayOfArrayOfSpeciesTag_g(), IndexSetToLast_sg_ArrayOfArrayOfStokesVector_g(), IndexSetToLast_sg_ArrayOfArrayOfString_g(), IndexSetToLast_sg_ArrayOfArrayOfTensor3_g(), IndexSetToLast_sg_ArrayOfArrayOfTensor6_g(), IndexSetToLast_sg_ArrayOfArrayOfTime_g(), IndexSetToLast_sg_ArrayOfArrayOfTransmissionMatrix_g(), IndexSetToLast_sg_ArrayOfArrayOfVector_g(), IndexSetToLast_sg_ArrayOfCIARecord_g(), IndexSetToLast_sg_ArrayOfGriddedField1_g(), IndexSetToLast_sg_ArrayOfGriddedField2_g(), IndexSetToLast_sg_ArrayOfGriddedField3_g(), IndexSetToLast_sg_ArrayOfGriddedField4_g(), IndexSetToLast_sg_ArrayOfIndex_g(), IndexSetToLast_sg_ArrayOfJacobianTarget_g(), IndexSetToLast_sg_ArrayOfMatrix_g(), IndexSetToLast_sg_ArrayOfPpath_g(), IndexSetToLast_sg_ArrayOfPropagationMatrix_g(), IndexSetToLast_sg_ArrayOfQuantumIdentifier_g(), IndexSetToLast_sg_ArrayOfRadiationVector_g(), IndexSetToLast_sg_ArrayOfRetrievalQuantity_g(), IndexSetToLast_sg_ArrayOfScatteringMetaData_g(), IndexSetToLast_sg_ArrayOfSingleScatteringData_g(), IndexSetToLast_sg_ArrayOfSparse_g(), IndexSetToLast_sg_ArrayOfSpeciesTag_g(), IndexSetToLast_sg_ArrayOfStokesVector_g(), IndexSetToLast_sg_ArrayOfString_g(), IndexSetToLast_sg_ArrayOfSun_g(), IndexSetToLast_sg_ArrayOfTelsemAtlas_g(), IndexSetToLast_sg_ArrayOfTensor3_g(), IndexSetToLast_sg_ArrayOfTensor4_g(), IndexSetToLast_sg_ArrayOfTensor5_g(), IndexSetToLast_sg_ArrayOfTensor6_g(), IndexSetToLast_sg_ArrayOfTensor7_g(), IndexSetToLast_sg_ArrayOfTime_g(), IndexSetToLast_sg_ArrayOfTransmissionMatrix_g(), IndexSetToLast_sg_ArrayOfVector_g(), IndexSetToLast_sg_ArrayOfXsecRecord_g(), and IndexSetToLast_sg_Vector_g().

◆ IndexSetToLast() [2/2]

void IndexSetToLast ( Workspace ,
Index &  nelem,
const ArrayOfAgenda x,
const Verbosity  
)
inline

Definition at line 220 of file m_basic_types.h.

References Array< base >::nelem().

◆ nelemGet()

void nelemGet ( Workspace ,
Index &  nelem,
const ArrayOfAgenda x,
const Verbosity  
)
inline

Definition at line 213 of file m_basic_types.h.

References Array< base >::nelem().

Referenced by nelemGet_sg_ArrayOfAbsorptionLines_g(), nelemGet_sg_ArrayOfAgenda_g(), nelemGet_sg_ArrayOfArrayOfAbsorptionLines_g(), nelemGet_sg_ArrayOfArrayOfGriddedField1_g(), nelemGet_sg_ArrayOfArrayOfGriddedField2_g(), nelemGet_sg_ArrayOfArrayOfGriddedField3_g(), nelemGet_sg_ArrayOfArrayOfIndex_g(), nelemGet_sg_ArrayOfArrayOfMatrix_g(), nelemGet_sg_ArrayOfArrayOfPropagationMatrix_g(), nelemGet_sg_ArrayOfArrayOfRadiationVector_g(), nelemGet_sg_ArrayOfArrayOfScatteringMetaData_g(), nelemGet_sg_ArrayOfArrayOfSingleScatteringData_g(), nelemGet_sg_ArrayOfArrayOfSpeciesTag_g(), nelemGet_sg_ArrayOfArrayOfStokesVector_g(), nelemGet_sg_ArrayOfArrayOfString_g(), nelemGet_sg_ArrayOfArrayOfTensor3_g(), nelemGet_sg_ArrayOfArrayOfTensor6_g(), nelemGet_sg_ArrayOfArrayOfTime_g(), nelemGet_sg_ArrayOfArrayOfTransmissionMatrix_g(), nelemGet_sg_ArrayOfArrayOfVector_g(), nelemGet_sg_ArrayOfCIARecord_g(), nelemGet_sg_ArrayOfGriddedField1_g(), nelemGet_sg_ArrayOfGriddedField2_g(), nelemGet_sg_ArrayOfGriddedField3_g(), nelemGet_sg_ArrayOfGriddedField4_g(), nelemGet_sg_ArrayOfIndex_g(), nelemGet_sg_ArrayOfJacobianTarget_g(), nelemGet_sg_ArrayOfMatrix_g(), nelemGet_sg_ArrayOfPpath_g(), nelemGet_sg_ArrayOfPropagationMatrix_g(), nelemGet_sg_ArrayOfQuantumIdentifier_g(), nelemGet_sg_ArrayOfRadiationVector_g(), nelemGet_sg_ArrayOfRetrievalQuantity_g(), nelemGet_sg_ArrayOfScatteringMetaData_g(), nelemGet_sg_ArrayOfSingleScatteringData_g(), nelemGet_sg_ArrayOfSparse_g(), nelemGet_sg_ArrayOfSpeciesTag_g(), nelemGet_sg_ArrayOfStokesVector_g(), nelemGet_sg_ArrayOfString_g(), nelemGet_sg_ArrayOfSun_g(), nelemGet_sg_ArrayOfTelsemAtlas_g(), nelemGet_sg_ArrayOfTensor3_g(), nelemGet_sg_ArrayOfTensor4_g(), nelemGet_sg_ArrayOfTensor5_g(), nelemGet_sg_ArrayOfTensor6_g(), nelemGet_sg_ArrayOfTensor7_g(), nelemGet_sg_ArrayOfTime_g(), nelemGet_sg_ArrayOfTransmissionMatrix_g(), nelemGet_sg_ArrayOfVector_g(), nelemGet_sg_ArrayOfXsecRecord_g(), and nelemGet_sg_Vector_g().