メインページ   モジュール   クラス階層   アルファベット順一覧   構成   ファイル一覧   構成メンバ   ファイルメンバ   関連ページ  

Ttypes.h

解説を見る。
00001 // =====================================================================
00002 //  $Id: Ttypes.h,v 1.12 2003/09/19 03:21:54 goiwai Exp $
00003 //  $Name: CLDAQ-1-08-02 $
00004 //
00005 //  $Log: Ttypes.h,v $
00006 //  Revision 1.12  2003/09/19 03:21:54  goiwai
00007 //  2003年7月に行なわれたビームテストの解析が一段落ついたので,バージョンを
00008 //  上げました.
00009 //
00010 //  Revision 1.11  2003/09/09 22:21:44  goiwai
00011 //  バージョンを1.8.1に変更しました.
00012 //
00013 //  Revision 1.10  2003/09/07 02:43:15  goiwai
00014 //  仕事の区切りとともにバージョンを更新しました.
00015 //  1.7.1 -> 1.8.0
00016 //
00017 //  Revision 1.9  2003/08/17 02:02:53  goiwai
00018 //  std::multimap と std::pair をそれぞれ Tmultimap, Tpair に typedef しま
00019 //  した.
00020 //  n行2列のテーブルを作る際に便利です.
00021 //  ベクターやリストと似ていますが,キーワードで要素を参照できる点で,可読性
00022 //  に優れており,扱いやすいです.
00023 //  逆に劣る箇所は,参照が面倒だということです.たとえば,
00024 //    Map::iterator itr = map.find( "KEY" );
00025 //    if ( itr ) {
00026 //      itr -> second; // 要素
00027 //      itr -> first;  // キー
00028 //    }
00029 //  といったかっこうになります.
00030 //
00031 //  Revision 1.8  2003/08/17 00:55:50  goiwai
00032 //  STL の std::map を Tmapとして typedef しました.
00033 //
00034 //  Revision 1.7  2003/08/05 23:05:00  goiwai
00035 //  バージョンを1.7.1にするためにTversionの値を変更しました.
00036 //
00037 //  Revision 1.6  2003/07/30 18:31:09  goiwai
00038 //  バージョンを1.7.0としました.
00039 //  ここまでのものを CLDAQ-1-07-00 としてタグします.
00040 //
00041 //  Revision 1.5  2003/07/30 16:21:22  goiwai
00042 //  ファイルにコミットログをつけることにしました.
00043 //
00044 // =====================================================================
00045 #ifndef __TTYPES_HH
00046 #define __TTYPES_HH
00047 
00048 #include <iostream.h>
00049 #include <iomanip.h>
00050 #include <fstream.h>
00051 #include <stdio.h>
00052 #include <string>
00053 #include <list>
00054 #include <vector>
00055 #include <map>
00056 #include <strstream.h>
00057 
00058 #define Tfalse 0
00059 #define Ttrue 1
00060 #define Tstd std
00061 #define Tios Tstd::ios
00062 #define Tin Tios::inin
00063 #define Tout Tios::out
00064 #define Tate Tios::ate
00065 #define Tapp Tios::app
00066 #define Ttrunc Tios::trunc
00067 #define Tnocreate Tios::nocreate
00068 #define Tnoreplace Tios::noreplace
00069 #define Tbin Tios::bin
00070 #define Tbinary Tios::binary
00071 #define Tgoodbit Tios::goodbit
00072 #define Teofbit Tios::eofbit
00073 #define Tfailbit Tios::failbit
00074 #define Tbadbit Tios::badbit
00075 #define Tostream Tstd::ostream
00076 #define Tostrstream Tstd::ostrstream
00077 #define Tistream Tstd::istream
00078 #define Tlist Tstd::list
00079 #define Tvector Tstd::vector
00080 #define Tmap Tstd::map
00081 #define Tmultimap Tstd::multimap
00082 #define Tpair Tstd::pair
00083 #define Tcout Tstd::cout
00084 #define Tcin Tstd::cin
00085 #define Tcerr Tstd::cerr
00086 #define Tendl Tstd::endl
00087 #define Tends Tstd::ends
00088 #define Tdec Tstd::dec
00089 #define Thex Tstd::hex
00090 #define Toct Tstd::oct
00091 #define Tflush Tstd::flush
00092 #define Tsizeof(_type_) sizeof(_type_)
00093 
00094 typedef double Tdouble;
00095 typedef int Tint;
00096 typedef float Tfloat;
00097 typedef char Tchar;
00098 typedef long Tlong;
00099 typedef unsigned char TUchar;
00100 typedef unsigned int TUint;
00101 typedef unsigned long TUlong;
00102 typedef short Tshort;
00103 typedef unsigned short TUshort;
00104 typedef bool Tbool;
00105 typedef Tbool Tbit;
00106 typedef FILE TFileStream;
00107 typedef size_t Tsize_t;
00108 typedef pid_t Tpid_t;
00109 typedef time_t Ttime_t;
00110 typedef socklen_t Tsocklen_t;
00111 typedef caddr_t Tcaddr_t;
00112 typedef off_t Toff_t;
00113 typedef pthread_t Tthread_t;
00114 typedef clock_t Tclock_t;
00115 typedef void Tvoid;
00116 typedef Tstd::string Tstring;
00117 typedef Tstd::ofstream Tofstream;
00118 typedef Tstd::ifstream Tifstream;
00119 typedef Tvector<Tint> TintList;
00120 typedef Tvector<TUint> TUintList;
00121 typedef Tvector<TUshort> TUshortList;
00122 typedef Tvector<Tdouble> TdoubleList;
00123 typedef Tvector<Tfloat> TfloatList;
00124 typedef Tvector<Tstring> TstringList;
00125 #ifdef __CLDAQ_ZLIB_USE
00126 typedef z_stream Tzstream;
00127 typedef Byte Tbyte;
00128 #endif
00129 
00130 static const Tstring Tspace = " ";
00131 static const Tstring Thyphen = "-";
00132 static const Tstring Tslash = "/";
00133 static const Tstring Twslash = Tslash + Tslash;
00134 static const Tstring Twquote = "\"";
00135 static const Tstring Tquote = "'";
00136 static const Tstring Tsharp = "#";
00137 static const Tstring Tpipe = "|";
00138 static const Tstring Tcolon = ":";
00139 static const Tstring Twspace = Tspace + Tspace;
00140 static const Tstring Ttab = "\t";
00141 static const Tstring Tbeep = "\b";
00142 static const Tstring Thour = "h";
00143 static const Tstring Tmin = "m";
00144 static const Tstring Tsec = "s";
00145 static const Tstring Tmsec = "ms";
00146 static const Tstring Tusec = "us";
00147 static const Tstring Tnsec = "ns";
00148 static const Tstring Tid = "$Id: Ttypes.h,v 1.12 2003/09/19 03:21:54 goiwai Exp $";
00149 static const Tstring Tname = "$Name: CLDAQ-1-08-02 $";
00150 static const Tstring Tproject = "CLDAQ";
00151 static const Tstring Tversion = "1.8.2";
00152 static const Tstring Texit = "exit";
00153 static const Tstring Tprompt = Tproject + Thyphen + Tversion + ">" + Tspace;
00154 static const Tchar Tkey = '\x01';
00155 static const Tchar Teol = '\n';
00156 
00157 enum Tobject_t { 
00158   tObjectDataRecord,
00159   tObjectDataSection,
00160   tObjectDataSegment,
00161   tObjectDataElement,
00162   tObject1DHistogram,
00163   tObject2DHistogram,
00164   tObjectAppendGraph,
00165   tObjectSubstituteGraph,
00166   tObjectNtuple,
00167   tNumberOfObjectTypes,
00168   tObjectUnknown = -1
00169 };
00170 
00171 enum Telement_t {
00172   tTypeInt,
00173   tTypeString,
00174   tTypeDouble,
00175   tTypeObject,
00176   tTypeFloat,
00177   tTypeUnsignedShort,
00178   tTypeShort,
00179   tTypeWord,
00180   tTypeLong,
00181   tTypeUnsignedLong,
00182   tTypeUnsignedInt,
00183   tNumberOfElementTypes,
00184   tTypeUnknown = -1
00185 };
00186 
00187 enum Tstream_t { 
00188   tFileStream,
00189   tSocketStream,
00190   tSharedMemoryStream,
00191   tNumberOfStreamTypes,
00192   tUnknownStream = -1
00193 };
00194 
00195 enum Trandom_t {
00196   tRandomExponential,
00197   tRandomGaussian,
00198   tRandomChiSquare,
00199   tRandomLandau,
00200   tRandomGamma,
00201   tRandomPoisson,
00202   tNumberOfRandomTypes,
00203   tRandomUnknown = -1
00204 };
00205 
00206 enum Tstatus_t {
00207   tStatusStandby,
00208   tStatusReady,
00209   tStatusBusy,
00210   tStatusIdle,
00211   tStatusWaitingReady,
00212   tStatusJustTakingEvent,
00213   tStatusJustRecordingEvent,
00214   tStatusSleep,
00215   tStatusDead,
00216   tNumberOfStatusTypes,
00217   tStatusUnknown = -1
00218 };
00219 
00220 enum TvmeTransfer_t {
00221   tA16D16,
00222   tA16D32,
00223   tA24D16,
00224   tA24D32,
00225   tA32D16,
00226   tA32D32,
00227   tA24D16dma,
00228   tA32D16dma,
00229   tA24D32dma,
00230   tA32D32dma, 
00231   tNumberOfVmeTransferModes,
00232   tTransferModeUnknown = -1
00233 };
00234 
00235 // with Sanshiro driver
00236 static const Tstring TvmeDevices[ tNumberOfVmeTransferModes ] =
00237 {
00238   "/dev/vmedrv16d16",
00239   "/dev/vmedrv16d32",
00240   "/dev/vmedrv24d16",
00241   "/dev/vmedrv24d32",
00242   "/dev/vmedrv32d16",
00243   "/dev/vmedrv32d32",
00244   "/dev/vmedrv24d16dma",
00245   "/dev/vmedrv32d16dma",
00246   "/dev/vmedrv24d32dma",
00247   "/dev/vmedrv32d32dma"
00248 };
00249 
00250 enum TcamacCrateController_t {
00251   tISAcc7000_1,
00252   tISAcc7000_2,
00253   tISAcc7000_3,
00254   tISAcc7000_4,
00255   tISAcc7700_1,
00256   tISAcc7700_2,
00257   tISAcc7700_3,
00258   tISAcc7700_4, 
00259   tPCIcc7700_1,
00260   tPCIcc7700_2,
00261   tPCIcc7700_3,
00262   tPCIcc7700_4,
00263   tNumberOfCamacCrateController,
00264   tCamacCrateControllerUnknown = -1
00265 };
00266 
00267 // with Yasu driver
00268 static const Tstring TcamacDevices[ tNumberOfCamacCrateController ] =
00269 {
00270   "/dev/ISAcc7000.1",
00271   "/dev/ISAcc7000.2",
00272   "/dev/ISAcc7000.3",
00273   "/dev/ISAcc7000.4",
00274   "/dev/ISAcc7700.1",
00275   "/dev/ISAcc7700.2",
00276   "/dev/ISAcc7700.3",
00277   "/dev/ISAcc7700.4",
00278   "/dev/PCIcc7700.1",
00279   "/dev/PCIcc7700.2",
00280   "/dev/PCIcc7700.3",
00281   "/dev/PCIcc7700.4"
00282 };
00283 
00284 enum Truninfo_t { 
00285   tInfoFreeValue,
00286   tInfoSelectableValue,
00287   tInfoFreeText,
00288   tNumberOfInformations,
00289   tInfoUnknown = -1
00290 };
00291 
00292 enum { 
00293   tIDunknown = -1
00294 };
00295 
00296 static const Tstring TunknownID = "unkown ID";
00297 
00298 #endif

CLDAQ - a Class Library for Data AcQuisition (Version 1.8.2)
Go IWAI <goiwai@users.sourceforge.jp>