| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

DybHelloWorld.cc

Go to the documentation of this file.
00001 #include "DybHelloWorld.h"
00002 
00003 using namespace std;
00004 
00005 DybHelloWorld::DybHelloWorld(const string& name, ISvcLocator* pSvcLocator) :
00006   GaudiAlgorithm(name, pSvcLocator), m_myInt(0), m_myBool(0), m_myDouble(0)
00007 {
00008   // Part 1: Declare the properties
00009   declareProperty("MyInt", m_myInt, "My Integer");
00010   declareProperty("MyBool", m_myBool, "My Bool");
00011   declareProperty("MyDouble", m_myDouble, "My Double");
00012   declareProperty("MyStringVec",m_myStringVec, "My String Vector");
00013   declareProperty("MyIntegerProperty", m_participant=40, "My Integer Property");    // [1]
00014   declareProperty("MyStringMap",m_myStringMap,"My String Map");
00015   declareProperty("MyStringVectorMap",m_myStringVectorMap,"My String Vector Map");
00016   m_participant.verifier().setBounds(0, 45);                                      // [2]
00017 }
00018 
00019 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
00020 
00021 StatusCode DybHelloWorld::initialize(){
00022   
00023   // Part 1: Print where you are
00024   info() << " DybHelloWorld initialize()" << endreq;
00025   
00026   // Part 2: Print out the property values
00027   info() << "  MyInt =     " << m_myInt << endreq;
00028   info() << "  MyBool =    " << (int)m_myBool << endreq;
00029   info() << "  MyDouble =  " << m_myDouble << endreq;
00030   
00031   for (unsigned int i=0; i<m_myStringVec.size(); i++) {
00032     info() << "  MyStringVec[" << i << "] = " << m_myStringVec[i] 
00033            << endreq;
00034   }
00035   
00036   {
00037       map<string,string>::iterator it, done = m_myStringMap.end();
00038       info () << "MyStringMap: {\n";
00039       for (it = m_myStringMap.begin(); it != done; ++it) {
00040           info() << "\t" << it->first << " : " << it->second << ",\n";
00041       }
00042       info () << "\t}" << endreq;
00043   }
00044   {
00045       map<string,vector<string> >::iterator it, done = m_myStringVectorMap.end();  
00046       info () << "MyStringVectorMap: {\n";
00047       for (it = m_myStringVectorMap.begin(); it != done; ++it) {
00048           info() << "\t" << it->first << " : [";
00049           vector<string>& vec = it->second;
00050           for (size_t ind = 0; ind < vec.size(); ++ind) {
00051               info() << " " << vec[ind];
00052           }
00053           info() << "]\n";
00054       }
00055       info () << "\t}" << endreq;
00056   }
00057   info() << "  MyIntegerProperty = " << m_participant
00058          << "  [Bounds are " << m_participant.verifier().lower()
00059          << " , " << m_participant.verifier().upper() << " ] "
00060          << endreq;
00061   
00062   return StatusCode::SUCCESS;
00063 }
00064 
00065 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
00066 
00067 StatusCode DybHelloWorld::execute() {
00068   
00069   // Part 1: Print where you are
00070   info() << "DybHelloWorld execute()" << endreq;
00071   
00072   // Part 2: Print out the different levels of messages
00073   verbose() << "A VERBOSE message" << endreq;
00074   debug() << "A DEBUG message" << endreq;
00075   info() << "An INFO message" << endreq;
00076   warning() << "A WARNING message" << endreq;
00077   error() << "An ERROR message" << endreq;
00078   fatal() << "A FATAL error message" << endreq;
00079   always() << "A ALWAYS message" << endreq;  
00080 
00081   return StatusCode::SUCCESS;
00082 }
00083 
00084 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
00085 
00086 StatusCode DybHelloWorld::finalize() {
00087   
00088   // Part 1: Print where you are
00089   info() << "DybHelloWorld finalize()" << endreq;
00090   
00091   return StatusCode::SUCCESS;
00092 }
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Mon Apr 11 20:09:52 2011 for DybHelloWorld by doxygen 1.4.7