00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __TTYPES_HH
00018 #define __TTYPES_HH
00019
00020 #include <iostream.h>
00021 #include <iomanip.h>
00022 #include <fstream.h>
00023 #include <stdio.h>
00024 #include <string>
00025 #include <list>
00026 #include <vector>
00027 #include <strstream.h>
00028
00029 #define Tfalse 0
00030 #define Ttrue 1
00031 #define Tstd std
00032 #define Tios Tstd::ios
00033 #define Tin Tios::inin
00034 #define Tout Tios::out
00035 #define Tate Tios::ate
00036 #define Tapp Tios::app
00037 #define Ttrunc Tios::trunc
00038 #define Tnocreate Tios::nocreate
00039 #define Tnoreplace Tios::noreplace
00040 #define Tbin Tios::bin
00041 #define Tbinary Tios::binary
00042 #define Tgoodbit Tios::goodbit
00043 #define Teofbit Tios::eofbit
00044 #define Tfailbit Tios::failbit
00045 #define Tbadbit Tios::badbit
00046 #define Tostream Tstd::ostream
00047 #define Tostrstream Tstd::ostrstream
00048 #define Tistream Tstd::istream
00049 #define Tlist Tstd::list
00050 #define Tvector Tstd::vector
00051 #define Tcout Tstd::cout
00052 #define Tcin Tstd::cin
00053 #define Tcerr Tstd::cerr
00054 #define Tendl Tstd::endl
00055 #define Tends Tstd::ends
00056 #define Tdec Tstd::dec
00057 #define Thex Tstd::hex
00058 #define Toct Tstd::oct
00059 #define Tflush Tstd::flush
00060 #define Tsizeof(_type_) sizeof(_type_)
00061
00062 typedef double Tdouble;
00063 typedef int Tint;
00064 typedef float Tfloat;
00065 typedef char Tchar;
00066 typedef long Tlong;
00067 typedef unsigned char TUchar;
00068 typedef unsigned int TUint;
00069 typedef unsigned long TUlong;
00070 typedef short Tshort;
00071 typedef unsigned short TUshort;
00072 typedef bool Tbool;
00073 typedef Tbool Tbit;
00074 typedef FILE TFileStream;
00075 typedef size_t Tsize_t;
00076 typedef pid_t Tpid_t;
00077 typedef time_t Ttime_t;
00078 typedef socklen_t Tsocklen_t;
00079 typedef caddr_t Tcaddr_t;
00080 typedef off_t Toff_t;
00081 typedef pthread_t Tthread_t;
00082 typedef clock_t Tclock_t;
00083 typedef void Tvoid;
00084 typedef Tstd::string Tstring;
00085 typedef Tstd::ofstream Tofstream;
00086 typedef Tstd::ifstream Tifstream;
00087 typedef Tvector<Tint> TintList;
00088 typedef Tvector<TUint> TUintList;
00089 typedef Tvector<TUshort> TUshortList;
00090 typedef Tvector<Tdouble> TdoubleList;
00091 typedef Tvector<Tfloat> TfloatList;
00092 typedef Tvector<Tstring> TstringList;
00093 #ifdef __CLDAQ_ZLIB_USE
00094 typedef z_stream Tzstream;
00095 typedef Byte Tbyte;
00096 #endif
00097
00098 static const Tstring Tspace = " ";
00099 static const Tstring Thyphen = "-";
00100 static const Tstring Tslash = "/";
00101 static const Tstring Twslash = Tslash + Tslash;
00102 static const Tstring Twquote = "\"";
00103 static const Tstring Tquote = "'";
00104 static const Tstring Tsharp = "#";
00105 static const Tstring Tpipe = "|";
00106 static const Tstring Tcolon = ":";
00107 static const Tstring Twspace = Tspace + Tspace;
00108 static const Tstring Ttab = "\t";
00109 static const Tstring Tbeep = "\b";
00110 static const Tstring Thour = "h";
00111 static const Tstring Tmin = "m";
00112 static const Tstring Tsec = "s";
00113 static const Tstring Tmsec = "ms";
00114 static const Tstring Tusec = "us";
00115 static const Tstring Tnsec = "ns";
00116 static const Tstring Tid = "$Id: Ttypes.h,v 1.7 2003/08/05 23:05:00 goiwai Exp $";
00117 static const Tstring Tname = "$Name: CLDAQ-1-07-01 $";
00118 static const Tstring Tproject = "CLDAQ";
00119 static const Tstring Tversion = "1.7.1";
00120 static const Tstring Texit = "exit";
00121 static const Tstring Tprompt = Tproject + Thyphen + Tversion + ">" + Tspace;
00122 static const Tchar Tkey = '\x01';
00123 static const Tchar Teol = '\n';
00124
00125 enum Tobject_t {
00126 tObjectDataRecord,
00127 tObjectDataSection,
00128 tObjectDataSegment,
00129 tObjectDataElement,
00130 tObject1DHistogram,
00131 tObject2DHistogram,
00132 tObjectAppendGraph,
00133 tObjectSubstituteGraph,
00134 tObjectNtuple,
00135 tNumberOfObjectTypes,
00136 tObjectUnknown = -1
00137 };
00138
00139 enum Telement_t {
00140 tTypeInt,
00141 tTypeString,
00142 tTypeDouble,
00143 tTypeObject,
00144 tTypeFloat,
00145 tTypeUnsignedShort,
00146 tTypeShort,
00147 tTypeWord,
00148 tTypeLong,
00149 tTypeUnsignedLong,
00150 tTypeUnsignedInt,
00151 tNumberOfElementTypes,
00152 tTypeUnknown = -1
00153 };
00154
00155 enum Tstream_t {
00156 tFileStream,
00157 tSocketStream,
00158 tSharedMemoryStream,
00159 tNumberOfStreamTypes,
00160 tUnknownStream = -1
00161 };
00162
00163 enum Trandom_t {
00164 tRandomExponential,
00165 tRandomGaussian,
00166 tRandomChiSquare,
00167 tRandomLandau,
00168 tRandomGamma,
00169 tRandomPoisson,
00170 tNumberOfRandomTypes,
00171 tRandomUnknown = -1
00172 };
00173
00174 enum Tstatus_t {
00175 tStatusStandby,
00176 tStatusReady,
00177 tStatusBusy,
00178 tStatusIdle,
00179 tStatusWaitingReady,
00180 tStatusJustTakingEvent,
00181 tStatusJustRecordingEvent,
00182 tStatusSleep,
00183 tStatusDead,
00184 tNumberOfStatusTypes,
00185 tStatusUnknown = -1
00186 };
00187
00188 enum TvmeTransfer_t {
00189 tA16D16,
00190 tA16D32,
00191 tA24D16,
00192 tA24D32,
00193 tA32D16,
00194 tA32D32,
00195 tA24D16dma,
00196 tA32D16dma,
00197 tA24D32dma,
00198 tA32D32dma,
00199 tNumberOfVmeTransferModes,
00200 tTransferModeUnknown = -1
00201 };
00202
00203
00204 static const Tstring TvmeDevices[ tNumberOfVmeTransferModes ] =
00205 {
00206 "/dev/vmedrv16d16",
00207 "/dev/vmedrv16d32",
00208 "/dev/vmedrv24d16",
00209 "/dev/vmedrv24d32",
00210 "/dev/vmedrv32d16",
00211 "/dev/vmedrv32d32",
00212 "/dev/vmedrv24d16dma",
00213 "/dev/vmedrv32d16dma",
00214 "/dev/vmedrv24d32dma",
00215 "/dev/vmedrv32d32dma"
00216 };
00217
00218 enum TcamacCrateController_t {
00219 tISAcc7000_1,
00220 tISAcc7000_2,
00221 tISAcc7000_3,
00222 tISAcc7000_4,
00223 tISAcc7700_1,
00224 tISAcc7700_2,
00225 tISAcc7700_3,
00226 tISAcc7700_4,
00227 tPCIcc7700_1,
00228 tPCIcc7700_2,
00229 tPCIcc7700_3,
00230 tPCIcc7700_4,
00231 tNumberOfCamacCrateController,
00232 tCamacCrateControllerUnknown = -1
00233 };
00234
00235
00236 static const Tstring TcamacDevices[ tNumberOfCamacCrateController ] =
00237 {
00238 "/dev/ISAcc7000.1",
00239 "/dev/ISAcc7000.2",
00240 "/dev/ISAcc7000.3",
00241 "/dev/ISAcc7000.4",
00242 "/dev/ISAcc7700.1",
00243 "/dev/ISAcc7700.2",
00244 "/dev/ISAcc7700.3",
00245 "/dev/ISAcc7700.4",
00246 "/dev/PCIcc7700.1",
00247 "/dev/PCIcc7700.2",
00248 "/dev/PCIcc7700.3",
00249 "/dev/PCIcc7700.4"
00250 };
00251
00252 enum Truninfo_t {
00253 tInfoFreeValue,
00254 tInfoSelectableValue,
00255 tInfoFreeText,
00256 tNumberOfInformations,
00257 tInfoUnknown = -1
00258 };
00259
00260 enum {
00261 tIDunknown = -1
00262 };
00263
00264 static const Tstring TunknownID = "unkown ID";
00265
00266 #endif