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

TReadoutElement.cc

解説を見る。
00001 // =====================================================================
00002 //  $Id: TReadoutElement.cc,v 1.5 2004/03/07 10:30:33 goiwai Exp $
00003 //  $Name: CLDAQ-1-14-03 $
00004 //  $Log: TReadoutElement.cc,v $
00005 //  Revision 1.5  2004/03/07 10:30:33  goiwai
00006 //  ROOTに組みこむためのおまじないマクロを埋めこみました。
00007 //  全てにおいて完全に動作するわけではありません。
00008 //
00009 //  Revision 1.4  2003/10/06 16:39:00  goiwai
00010 //  *** empty log message ***
00011 //
00012 //  Revision 1.3  2003/07/30 16:20:11  goiwai
00013 //  ファイルにコミットログをつけることにしました.
00014 //
00015 // =====================================================================
00016 #include "TReadoutElement.hh"
00017 #include "TDataElement.hh"
00018 #include "TModule.hh"
00019 
00020 TReadoutElement::TReadoutElement( TModule* module, const Tstring& id, Tint ch )
00021   : TReadoutIdentification( id ), theModule( module ), theChannelNumber( ch )
00022 {
00023   // チャンネル番号が省略されたら,IDをチャンネル番号にしようと試みる
00024   if ( theChannelNumber < 0 ) {
00025     Tbool isiddigit = Ttrue;
00026     for ( Tsize_t i = 0; i < theID.size(); i ++ ) {
00027       if ( !isdigit( theID[ i ] ) ) {
00028         isiddigit = Tfalse;
00029         break;
00030       }
00031     }
00032     if ( isiddigit ) {
00033       theChannelNumber = (Tint)strtol( theID.c_str(), 0, 0 );
00034     }
00035   }
00036 }
00037 
00038 TReadoutElement::TReadoutElement( TModule* module, Tint ch, const Tstring& id )
00039   : TReadoutIdentification( id ), theModule( module ), theChannelNumber( ch )
00040 {
00041   if ( theID == TunknownID ) {
00042     theID = itostr( ch, 1 );
00043   }
00044 }
00045 
00046 TReadoutElement::TReadoutElement( const TReadoutElement& right )
00047   : TReadoutIdentification( right ), 
00048     theModule( right.theModule ),
00049     theChannelNumber( right.theChannelNumber )
00050 {;}
00051 
00052 TReadoutElement::~TReadoutElement()
00053 {;}
00054 
00055 TDataElement TReadoutElement::Read( Tint ch )
00056 {
00057   TDataElement element( tTypeUnknown, theID );
00058   theModule -> FillData( element, ch );
00059   return element;
00060 }
00061 
00062 TDataElement TReadoutElement::Read()
00063 {
00064   return Read( theChannelNumber );
00065 }
00066 
00067 const TReadoutElement& TReadoutElement::operator=( const TReadoutElement& right )
00068 {
00069   *( (TReadoutIdentification*)this ) = *( (TReadoutIdentification*)(&right) );
00070   theModule = right.theModule;
00071   theChannelNumber = right.theChannelNumber;
00072   return *this;
00073 }
00074 
00075 Tbool TReadoutElement::operator==( const TReadoutElement& right ) const
00076 {
00077   Tbool retval = Ttrue;
00078   retval &= ( *( (TReadoutIdentification*)this ) == *( (TReadoutIdentification*)(&right) ) );
00079   retval &= ( *theModule == *(right.theModule) );
00080   retval &= ( theChannelNumber == right.theChannelNumber );
00081   return retval;
00082 }
00083 
00084 Tbool TReadoutElement::operator!=( const TReadoutElement& right ) const
00085 {
00086   Tbool retval = Tfalse;
00087   retval |= ( *( (TReadoutIdentification*)this ) != *( (TReadoutIdentification*)(&right) ) );
00088   retval |= ( *theModule != *(right.theModule) );
00089   retval |= ( theChannelNumber != right.theChannelNumber );
00090   return retval;
00091 }
00092 
00093 #ifdef __CLDAQ_ROOT_DLL
00094     ClassImp(TReadoutElement)
00095 #endif


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