ARTS 2.5.0 (git: 9ee3ac6c)
m_general.h
Go to the documentation of this file.
1/* Copyright (C) 2003-2012 Oliver Lemke <olemke@core-dump.info>
2
3 This program is free software; you can redistribute it and/or
4 modify it under the terms of the GNU General Public License as
5 published by the Free Software Foundation; either version 2 of the
6 License, or (at your option) any later version.
7
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12
13 You should have received a copy of the GNU General Public License
14 along with this program; if not, write to the Free Software
15 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
16 USA. */
17
27#ifndef m_general_h
28#define m_general_h
29
30#include "arts.h"
31
32#include <iostream>
33#ifdef TIME_SUPPORT
34#include <sys/times.h>
35#endif
36#include <stdexcept>
37#include "cia.h"
38#include "messages.h"
39#include "mystring.h"
40#include "ppath.h"
41#include "special_interp.h"
42#include "tessem.h"
43
44class Workspace;
45
46#define SWITCH_OUTPUT(x, y) \
47 { \
48 ostringstream so_os; \
49 so_os << y << '\n'; \
50 switch (x) { \
51 case 0: \
52 out0 << so_os.str(); \
53 break; \
54 case 1: \
55 out1 << so_os.str(); \
56 break; \
57 case 2: \
58 out2 << so_os.str(); \
59 break; \
60 case 3: \
61 out3 << so_os.str(); \
62 break; \
63 default: \
64 throw runtime_error("Output level must have value from 0-3"); \
65 } \
66 }
67
68class Timer {
69 public:
70 Timer() : running(false), finished(false) {}
71 bool running;
73#ifdef TIME_SUPPORT
74 struct tms cputime_start;
75 clock_t realtime_start;
76 struct tms cputime_end;
77 clock_t realtime_end;
78#endif
79};
80
81/* Workspace method: Doxygen documentation will be auto-generated */
82template <typename T>
83void Print(
84 // WS Generic Input:
85 const T& x,
86 // Keywords:
87 const Index& level,
88 const Verbosity& verbosity) {
90 SWITCH_OUTPUT(level, x)
91}
92
93/* Workspace method: Doxygen documentation will be auto-generated */
94void Print(Workspace& ws,
95 // WS Generic Input:
96 const Agenda& x,
97 // Keywords:
98 const Index& level,
99 const Verbosity& verbosity);
100
101/* Workspace method: Doxygen documentation will be auto-generated */
102void Print(Workspace& ws,
103 // WS Generic Input:
104 const ArrayOfAgenda& x,
105 // Keywords:
106 const Index& level,
107 const Verbosity& verbosity);
108
109/* Workspace method: Doxygen documentation will be auto-generated */
110void Print( // WS Generic Input:
111 const ArrayOfGridPos& x,
112 // Keywords:
113 const Index& level,
114 const Verbosity& verbosity);
115
116/* Workspace method: Doxygen documentation will be auto-generated */
117void Print( // WS Generic Input:
118 const ArrayOfCIARecord& x,
119 // Keywords:
120 const Index& level,
121 const Verbosity& verbosity);
122
123/* Workspace method: Doxygen documentation will be auto-generated */
124void Print( // WS Generic Input:
125 const ArrayOfString& x,
126 // Keywords:
127 const Index& level,
128 const Verbosity& verbosity);
129
130/* Workspace method: Doxygen documentation will be auto-generated */
131void Print( // WS Generic Input:
132 const Ppath& ppath,
133 // Keywords:
134 const Index& level,
135 const Verbosity& verbosity);
136
137/* Workspace method: Doxygen documentation will be auto-generated */
138void Print( // WS Generic Input:
139 const ArrayOfPpath& x,
140 // Keywords:
141 const Index& level,
142 const Verbosity& verbosity);
143
144/* Workspace method: Doxygen documentation will be auto-generated */
145void Print( // WS Generic Input:
146 const Timer& x,
147 // Keywords:
148 const Index& level,
149 const Verbosity& verbosity);
150
151/* Workspace method: Doxygen documentation will be auto-generated */
152void Print( // WS Generic Input:
153 const TessemNN& x,
154 // Keywords:
155 const Index& level,
156 const Verbosity& verbosity);
157
158/* Workspace method: Doxygen documentation will be auto-generated */
159void PrintWorkspace( // Workspace reference
160 Workspace& ws,
161 // Keywords:
162 const Index& only_allocated,
163 const Index& level,
164 const Verbosity& verbosity);
165
166#endif /* m_general_h */
The global header file for ARTS.
Header file for work with HITRAN collision induced absorption (CIA).
The Agenda class.
Definition: agenda_class.h:44
This can be used to make arrays out of anything.
Definition: array.h:107
bool running
Definition: m_general.h:71
Timer()
Definition: m_general.h:70
bool finished
Definition: m_general.h:72
Workspace class.
Definition: workspace_ng.h:40
#define SWITCH_OUTPUT(x, y)
Definition: m_general.h:46
void Print(const T &x, const Index &level, const Verbosity &verbosity)
WORKSPACE METHOD: Print.
Definition: m_general.h:83
void PrintWorkspace(Workspace &ws, const Index &only_allocated, const Index &level, const Verbosity &verbosity)
Definition: m_general.cc:309
INDEX Index
The type to use for all integer numbers and indices.
Definition: matpack.h:39
Declarations having to do with the four output streams.
#define CREATE_OUTS
Definition: messages.h:209
This file contains the definition of String, the ARTS string class.
Propagation path structure and functions.
Header file for special_interp.cc.
The structure to describe a propagation path and releated quantities.
Definition: ppath.h:48
This file contains functions that are adapted from TESSEM code which is used to calculate surface emi...