ARTS  2.0.49
m_general.h
Go to the documentation of this file.
1 /* Copyright (C) 2003-2008 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 "messages.h"
38 #include "ppath.h"
39 #include "special_interp.h"
40 #include "mystring.h"
41 
42 class Workspace;
43 
44 #define SWITCH_OUTPUT(x,y) \
45 switch (x) { \
46 case 0: out0 << y << "\n";break; \
47 case 1: out1 << y << "\n";break; \
48 case 2: out2 << y << "\n";break; \
49 case 3: out3 << y << "\n";break; \
50 default: throw runtime_error ("Output level must have value from 0-3"); \
51 }
52 
53 
54 struct Timer {
55 #ifdef TIME_SUPPORT
56  struct tms cputime;
57  clock_t realtime;
58 #endif
59 };
60 
61 /* Workspace method: Doxygen documentation will be auto-generated */
62 template<typename T> void
64  // WS Generic Input:
65  const T& x,
66  // Keywords:
67  const Index& level,
68  const Verbosity& verbosity)
69 {
71  SWITCH_OUTPUT (level, x)
72 }
73 
74 
75 /* Workspace method: Doxygen documentation will be auto-generated */
76 void
77 Print(Workspace& ws,
78  // WS Generic Input:
79  const Agenda& x,
80  // Keywords:
81  const Index& level,
82  const Verbosity& verbosity);
83 
84 
85 /* Workspace method: Doxygen documentation will be auto-generated */
86 void
87 Print(// WS Generic Input:
88  const ArrayOfGridPos& x,
89  // Keywords:
90  const Index& level,
91  const Verbosity& verbosity);
92 
93 
94 /* Workspace method: Doxygen documentation will be auto-generated */
95 void
96 Print(// WS Generic Input:
97  const ArrayOfIndex& x,
98  // Keywords:
99  const Index& level,
100  const Verbosity& verbosity);
101 
102 
103 /* Workspace method: Doxygen documentation will be auto-generated */
104 void
105 Print(// WS Generic Input:
106  const ArrayOfString& x,
107  // Keywords:
108  const Index& level,
109  const Verbosity& verbosity);
110 
111 
112 /* Workspace method: Doxygen documentation will be auto-generated */
113 void
114 Print(// WS Generic Input:
115  const Ppath& ppath,
116  // Keywords:
117  const Index& level,
118  const Verbosity& verbosity);
119 
120 
121 /* Workspace method: Doxygen documentation will be auto-generated */
122 void Print(// WS Generic Input:
123  const ArrayOfPpath& x,
124  // Keywords:
125  const Index& level,
126  const Verbosity& verbosity);
127 
128 
129 /* Workspace method: Doxygen documentation will be auto-generated */
130 void Print(// WS Generic Input:
131  const Timer& x,
132  // Keywords:
133  const Index& level,
134  const Verbosity& verbosity);
135 
136 
137 /* Workspace method: Doxygen documentation will be auto-generated */
138 void PrintWorkspace(// Workspace reference
139  Workspace& ws,
140  // Keywords:
141  const Index& only_allocated,
142  const Index& level,
143  const Verbosity& verbosity);
144 
145 #endif /* m_general_h */
146 
Timer
Definition: m_general.h:54
Print
void Print(const T &x, const Index &level, const Verbosity &verbosity)
WORKSPACE METHOD: Print.
Definition: m_general.h:63
SWITCH_OUTPUT
#define SWITCH_OUTPUT(x, y)
Definition: m_general.h:44
Ppath
The structure to describe a propagation path and releated quantities.
Definition: ppath.h:59
Agenda
The Agenda class.
Definition: agenda_class.h:44
Array< GridPos >
messages.h
Declarations having to do with the four output streams.
Verbosity
Definition: messages.h:50
ppath.h
Propagation path structure and functions.
Workspace
Workspace class.
Definition: workspace_ng.h:47
special_interp.h
Header file for special_interp.cc.
PrintWorkspace
void PrintWorkspace(Workspace &ws, const Index &only_allocated, const Index &level, const Verbosity &verbosity)
Definition: m_general.cc:221
Index
INDEX Index
The type to use for all integer numbers and indices.
Definition: matpack.h:39
mystring.h
This file contains the definition of String, the ARTS string class.
CREATE_OUTS
#define CREATE_OUTS
Definition: messages.h:210
arts.h
The global header file for ARTS.