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

TModuleSpecified.cc

解説を見る。
00001 // =====================================================================
00002 //  $Id: TModuleSpecified.cc,v 1.4 2004/03/07 10:30:31 goiwai Exp $
00003 //  $Name: CLDAQ-1-14-03 $
00004 //  $Log: TModuleSpecified.cc,v $
00005 //  Revision 1.4  2004/03/07 10:30:31  goiwai
00006 //  ROOTに組みこむためのおまじないマクロを埋めこみました。
00007 //  全てにおいて完全に動作するわけではありません。
00008 //
00009 //  Revision 1.3  2003/10/06 17:02:40  goiwai
00010 //  *** empty log message ***
00011 //
00012 //  Revision 1.2  2003/07/30 16:19:10  goiwai
00013 //  ファイルにコミットログをつけることにしました.
00014 //
00015 // =====================================================================
00016 #include "TModuleSpecified.hh"
00017 
00018 TModuleSpecified::TModuleSpecified()
00019   : theModuleID(), theGroupIDs(), theModule( 0 )
00020 {
00021   theGroupIDs.clear();
00022 }
00023 
00024 TModuleSpecified::TModuleSpecified( const Tstring& id, const TstringList& groups, TModule* module )
00025   : theModuleID( id ), theGroupIDs( groups ), theModule( module )
00026 {;}
00027 
00028 TModuleSpecified::TModuleSpecified( const TModuleSpecified& right )
00029   : theModuleID( right.theModuleID ), theGroupIDs( right.theGroupIDs ),
00030     theModule( right.theModule )
00031 {;}
00032 
00033 TModuleSpecified::~TModuleSpecified()
00034 {;}
00035 
00036 const TModuleSpecified& TModuleSpecified::operator=( const TModuleSpecified& right )
00037 {
00038   theModuleID = right.theModuleID;
00039   theGroupIDs = right.theGroupIDs;
00040   theModule = right.theModule;
00041   return *this;
00042 }
00043 
00044 Tbool TModuleSpecified::operator==( const TModuleSpecified& right ) const
00045 {
00046   Tbool retval = Ttrue;
00047   retval &= ( theModuleID == right.theModuleID );
00048   retval &= ( theGroupIDs == right.theGroupIDs );
00049   retval &= ( theModule == right.theModule );
00050   return retval;
00051 }
00052 
00053 Tbool TModuleSpecified::operator!=( const TModuleSpecified& right ) const
00054 {
00055   Tbool retval = Tfalse;
00056   retval |= ( theModuleID != right.theModuleID );
00057   retval |= ( theGroupIDs != right.theGroupIDs );
00058   retval |= ( theModule != right.theModule );
00059   return retval;
00060 }
00061 
00062 Tbool TModuleSpecified::IsSameGroup( const TstringList& groups )
00063 {
00064   for ( Tsize_t i = 0; i < theGroupIDs.size(); i ++ ) {
00065     for ( Tsize_t j = 0; j < groups.size(); j ++ ) {
00066       if ( theGroupIDs[ i ] == groups[ j ] ) {
00067         return Ttrue;
00068       }
00069     }
00070   }
00071   return Tfalse;
00072 }
00073 
00074 Tbool TModuleSpecified::IsSameGroup( const TModuleSpecified& spec )
00075 {
00076   return IsSameGroup( spec.GetGroupIDs() );
00077 }
00078 
00079 Tbool TModuleSpecified::IsSameGroup( const Tstring& group )
00080 {
00081   TstringList groups;
00082   groups.push_back( group );
00083   return IsSameGroup( groups );
00084 }
00085 
00086 Tostream& operator<<( Tostream& tos, const TModuleSpecified& right )
00087 {
00088   tos << "ID: " << right.theModuleID << ", ";
00089   tos << "GID(s): ";
00090   Tsize_t ngroups = right.theGroupIDs.size();
00091   for ( Tsize_t i = 0; i < ngroups; i ++ ) {
00092     tos << right.theGroupIDs[ i ] << ", ";
00093   }
00094   tos << right.theModule << Tflush;
00095   return tos;
00096 }
00097 
00098 #ifdef __CLDAQ_ROOT_DLL
00099     ClassImp(TModuleSpecified)
00100 #endif


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