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

TAnalysisStatus.cc

解説を見る。
00001 // =====================================================================
00002 //  $Id: TAnalysisStatus.cc,v 1.4 2004/03/07 10:30:27 goiwai Exp $
00003 //  $Name: CLDAQ-1-14-03 $
00004 //  $Log: TAnalysisStatus.cc,v $
00005 //  Revision 1.4  2004/03/07 10:30:27  goiwai
00006 //  ROOTに組みこむためのおまじないマクロを埋めこみました。
00007 //  全てにおいて完全に動作するわけではありません。
00008 //
00009 //  Revision 1.3  2003/10/06 17:02:36  goiwai
00010 //  *** empty log message ***
00011 //
00012 //  Revision 1.2  2003/07/30 16:17:10  goiwai
00013 //  ファイルにコミットログをつけることにしました.
00014 //
00015 // =====================================================================
00016 #include "TAnalysisStatus.hh"
00017 #include "Tsuffix.h"
00018 
00019 TAnalysisStatus::TAnalysisStatus( const Tstring& id, Tobject_t type, const Tstring& objectid, const Tstring& canvasid, Tstatus_t status )
00020   : theID( id ), theObjectType( type ), theDrawableObjectID( objectid ),
00021     theCanvasID( canvasid ), theStatus( status ), theThreadID( 0 )
00022 {
00023   SetObjectType( theObjectType );
00024   theStatus = tStatusDead;
00025 }
00026 
00027 TAnalysisStatus::TAnalysisStatus( const TAnalysisStatus& right )
00028   : theID( right.theID ), theObjectType( right.theObjectType ),
00029     theDrawableObjectID( right.theDrawableObjectID ),
00030     theCanvasID( right.theCanvasID ), theStatus( right.theStatus ),
00031     theThreadID( right.theThreadID )
00032 {;}
00033 
00034 TAnalysisStatus::~TAnalysisStatus()
00035 {;}
00036 
00037 const TAnalysisStatus& TAnalysisStatus::operator=( const TAnalysisStatus& right )
00038 {
00039   theID = right.theID;
00040   theObjectType = right.theObjectType;
00041   theDrawableObjectID = right.theDrawableObjectID;
00042   theCanvasID = right.theCanvasID;
00043   theStatus = right.theStatus;
00044   theThreadID = right.theThreadID;
00045   return *this;
00046 }
00047 
00048 Tbool TAnalysisStatus::operator==( const TAnalysisStatus& right ) const
00049 {
00050   Tbool retval = Ttrue;
00051   retval &= ( theID == right.theID );
00052   retval &= ( theObjectType == right.theObjectType );
00053   retval &= ( theDrawableObjectID == right.theDrawableObjectID );
00054   retval &= ( theCanvasID == right.theCanvasID );
00055   retval &= ( theStatus == right.theStatus );
00056   retval &= ( theThreadID == right.theThreadID );
00057   return retval;
00058 }
00059 
00060 Tbool TAnalysisStatus::operator!=( const TAnalysisStatus& right ) const
00061 {
00062   Tbool retval = Tfalse;
00063   retval |= ( theID != right.theID );
00064   retval |= ( theObjectType != right.theObjectType );
00065   retval |= ( theDrawableObjectID != right.theDrawableObjectID );
00066   retval |= ( theCanvasID != right.theCanvasID );
00067   retval |= ( theStatus != right.theStatus );
00068   retval |= ( theThreadID != right.theThreadID );
00069   return retval;
00070 }
00071 
00072 Tostream& operator<<( Tostream& tos, const TAnalysisStatus& right )
00073 {
00074   tos << right.theID << ": ";
00075   Tstring msgbuf;
00076   switch ( right.theObjectType ) {
00077     case tObject1DHistogram:
00078       msgbuf = "Histogram(1D)";
00079       break;
00080     case tObject2DHistogram:
00081       msgbuf = "Histogram(2D)";
00082       break;
00083     case tObjectAppendGraph:
00084       msgbuf = "Graph(App)";
00085       break;
00086     case tObjectSubstituteGraph:
00087       msgbuf = "Graph(Sub)";
00088       break;
00089     case tObjectNtuple:
00090       msgbuf = "Ntuple";
00091       break;
00092     default:
00093       msgbuf = "Unknown";
00094       break;
00095   }
00096   tos << msgbuf << "(" << right.theObjectType << ")" << Twspace;
00097   tos << right.theCanvasID << Twspace;
00098   switch ( right.theStatus ) {
00099     case tStatusStandby:
00100       msgbuf = "Standby";
00101       break;
00102     case tStatusReady:
00103       msgbuf = "Ready";
00104       break;
00105     case tStatusBusy:
00106       msgbuf = "Busy";
00107       break;
00108     case tStatusIdle:
00109       msgbuf = "Idle";
00110       break;
00111     case tStatusWaitingReady:
00112       msgbuf = "WaitingReady";
00113       break;
00114     case tStatusDead:
00115       msgbuf = "Dead";
00116       break;
00117     case tStatusSleep:
00118       msgbuf = "Sleep";
00119       break;
00120     default:
00121       msgbuf = "Unknown";
00122       break;
00123   }
00124   tos << msgbuf << "(" << right.theStatus << ")" << Twspace;
00125   tos << "Thread(" << right.theThreadID << ")" << Tflush;
00126   return tos;
00127 }
00128 
00129 Tvoid TAnalysisStatus::SetObjectType( Tobject_t type )
00130 {
00131   theObjectType = type;
00132   switch ( theObjectType ) {
00133     case tObject1DHistogram:
00134       theDrawableObjectID = theID + T1DHistogramSuffix;
00135       break;
00136     case tObject2DHistogram:
00137       theDrawableObjectID = theID + T2DHistogramSuffix;
00138       break;
00139     case tObjectAppendGraph:
00140       theDrawableObjectID = theID + TAppendGraphSuffix;
00141       break;
00142     case tObjectSubstituteGraph:
00143       theDrawableObjectID = theID + TSubstituteGraphSuffix;
00144       break;
00145     case tObjectNtuple:
00146     default:
00147       theDrawableObjectID = theID + TUnknownSuffix;
00148       break;
00149   }
00150   theCanvasID = theID + TCanvasSuffix;
00151   return;
00152 }
00153 
00154 #ifdef __CLDAQ_ROOT_DLL
00155     ClassImp(TAnalysisStatus)
00156 #endif


CLDAQ - a Class Library for DataAcQuisition (Version 1.14.3)
Go IWAI -- goiwai at users.sourceforge.jp