/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/BesExamples/ExHelloWorld/ExHelloWorld-00-00-03/src/HelloWorld.cxx

Go to the documentation of this file.
00001 #include "ExHelloWorld/HelloWorld.h"
00002 #include "GaudiKernel/MsgStream.h"
00003 
00005 
00006 HelloWorld::HelloWorld(const std::string& name, ISvcLocator* pSvcLocator) :
00007   Algorithm(name, pSvcLocator), m_myInt(0), m_myBool(0), m_myDouble(0)
00008 {
00009   // Part 1: Declare the properties
00010   declareProperty("MyInt", m_myInt);
00011   declareProperty("MyBool", m_myBool);
00012   declareProperty("MyDouble", m_myDouble);
00013   declareProperty("MyStringVec",m_myStringVec);
00014 }
00015 
00016 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
00017 
00018 StatusCode HelloWorld::initialize(){
00019 
00020   // Part 1: Get the messaging service, print where you are
00021   MsgStream log(msgSvc(), name());
00022   log << MSG::INFO << " HelloWorld initialize()" << endreq;
00023 
00024   // Part 2: Print out the property values
00025   log << MSG::INFO << "  MyInt =    " << m_myInt << endreq;
00026   log << MSG::INFO << "  MyBool =   " << (int)m_myBool << endreq;
00027   log << MSG::INFO << "  MyDouble = " << m_myDouble << endreq;
00028   
00029   for (unsigned int i=0; i<m_myStringVec.size(); i++) {
00030     log << MSG::INFO << "  MyStringVec[" << i << "] = " << m_myStringVec[i] 
00031         << endreq;
00032   }
00033   
00034   return StatusCode::SUCCESS;
00035 }
00036 
00037 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
00038 
00039 StatusCode HelloWorld::execute() {
00040 
00041   // Part 1: Get the messaging service, print where you are
00042   MsgStream log(msgSvc(), name());
00043   log << MSG::INFO << "AtlasHelloWorld execute()" << endreq;
00044 
00045   // Part 2: Print out the different levels of messages
00046   log << MSG::DEBUG << "A DEBUG message" << endreq;
00047   log << MSG::INFO << "An INFO message" << endreq;
00048   log << MSG::WARNING << "A WARNING message" << endreq;
00049   log << MSG::ERROR << "An ERROR message" << endreq;
00050   log << MSG::FATAL << "A FATAL error message" << endreq;
00051 
00052   return StatusCode::SUCCESS;
00053 }
00054 
00055 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
00056 
00057 StatusCode HelloWorld::finalize() {
00058 
00059   // Part 1: Get the messaging service, print where you are
00060   MsgStream log(msgSvc(), name());
00061   log << MSG::INFO << "HelloWorld finalize()" << endreq;
00062   
00063   return StatusCode::SUCCESS;
00064 }
00065 

Generated on Tue Nov 29 22:57:47 2016 for BOSS_7.0.2 by  doxygen 1.4.7