00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00027 #ifndef m_general_h
00028 #define m_general_h
00029
00030 #if HAVE_CONFIG_H
00031 #include <config.h>
00032 #else
00033 #error "Please run ./configure in the top arts directory before compiling."
00034 #endif
00035
00036 #include <iostream>
00037 #if HAVE_UNISTD_H
00038 # include <sys/types.h>
00039 # include <unistd.h>
00040 #endif
00041 #ifdef _POSIX_VERSION
00042 #include <sys/times.h>
00043 #endif
00044 #include <stdexcept>
00045 #include "messages.h"
00046 #include "ppath.h"
00047 #include "special_interp.h"
00048 #include "mystring.h"
00049
00050 class Workspace;
00051
00052 #define SWITCH_OUTPUT(x,y) switch (x) { \
00053 case 0: out0 << y << "\n";break; \
00054 case 1: out1 << y << "\n";break; \
00055 case 2: out2 << y << "\n";break; \
00056 case 3: out3 << y << "\n";break; \
00057 default: throw runtime_error ("Output level must have value from 0-3"); \
00058 }
00059
00060
00061 typedef struct {
00062 #ifdef _POSIX_VERSION
00063 struct tms cputime;
00064 clock_t realtime;
00065 #endif
00066 } Timer;
00067
00068
00069 template<typename T> void
00070 Print(
00071
00072 const T& x,
00073
00074 const Index& level )
00075 {
00076 SWITCH_OUTPUT (level, x);
00077 }
00078
00079
00080
00081 void
00082 Print(Workspace& ws,
00083
00084 const Agenda& x,
00085
00086 const Index& level );
00087
00088
00089
00090 void
00091 Print(
00092
00093 const ArrayOfGridPos& x,
00094
00095 const Index& level );
00096
00097
00098
00099 void
00100 Print(
00101
00102 const ArrayOfIndex& x,
00103
00104 const Index& level );
00105
00106
00107
00108 void
00109 Print(
00110
00111 const ArrayOfString& x,
00112
00113 const Index& level );
00114
00115
00116
00117 void
00118 Print(
00119
00120 const Ppath& ppath,
00121
00122 const Index& level );
00123
00124
00125
00126 void Print(
00127
00128 const ArrayOfPpath& x,
00129
00130 const Index& level );
00131
00132
00133
00134 void Print(
00135
00136 const Timer& x,
00137
00138 const Index& level);
00139
00140
00141
00142 void PrintWorkspace(
00143
00144 Workspace& ws,
00145
00146 const Index& only_allocated,
00147 const Index& level);
00148
00149 #endif
00150