Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Related Pages

LocalUtils.h

00001 #ifndef SCTAPIIPC_LOCALUTILS_H
00002 #define SCTAPIIPC_LOCALUTILS_H
00003 
00004 static Sct_SctApi::SctApiException myRaise( ::SctApi::SctApiException &s);
00005 static inline SctApi::BankType myTranslateBank(Sct_SctApi::BankType bank);
00006 
00007 Sct_SctApi::SctApiException myRaise( ::SctApi::SctApiException &c) 
00008 {
00009   cout << "Raising exception " << c.what() << endl;
00010   return Sct_SctApi::SctApiException(c.what());
00011 }
00012 
00013 
00014 SctApi::BankType myTranslateBank(Sct_SctApi::BankType bank) {
00015 
00016   SctApi::BankType result;
00017   switch(bank) {
00018   case Sct_SctApi::PHYSICS_CONFIG:
00019     result = ::SctApi::SCTAPI_BANK_PHYSICS;
00020     break;
00021   case Sct_SctApi::CALIBRATION_CONFIG:
00022     result = SctApi::SCTAPI_BANK_CALIBRATION;
00023     break;
00024   case Sct_SctApi::SCAN_CONFIG:
00025     result = SctApi::SCTAPI_BANK_SCAN;
00026     break;
00027   default:
00028     result = SctApi::SCTAPI_BANK_PHYSICS;
00029     break;
00030   }
00031   return result;
00032 }
00033 
00034 static inline
00035 std::list<SctApi::BankType> myTranslateBanks(const Sct_SctApi::BankList& banks){
00036   std::list<SctApi::BankType> copied;
00037   for (unsigned i=0; i<banks.length(); ++i){
00038     copied.push_back(myTranslateBank(banks[i]));
00039   }
00040   return copied;
00041 }
00042 #endif

Generated on Fri Sep 16 18:01:52 2005 for SCT DAQ/DCS Software - C++ by doxygen 1.3.5