#include <ConcreteAlgorithm.h>
Inheritance diagram for ConcreteAlgorithm:
Public Types | |
SUCCESS | |
NO_INTERFACE | |
VERSMISMATCH | |
LAST_ERROR | |
enum | Status |
Public Member Functions | |
ConcreteAlgorithm (const std::string &name, ISvcLocator *svcloc) | |
virtual | ~ConcreteAlgorithm () |
StatusCode | initialize () |
StatusCode | reinitialize () |
StatusCode | beginRun () |
StatusCode | execute () |
StatusCode | endRun () |
StatusCode | finalize () |
StatusCode | setProperty (const Property &p) |
virtual StatusCode | sysStart () |
virtual StatusCode | sysInitialize () |
virtual StatusCode | sysReinitialize () |
virtual StatusCode | sysRestart () |
virtual StatusCode | sysExecute () |
virtual StatusCode | sysStop () |
virtual StatusCode | sysFinalize () |
virtual StatusCode | sysBeginRun () |
virtual StatusCode | sysEndRun () |
virtual const std::string & | name () const |
virtual const std::string & | version () const |
virtual StatusCode | configure () |
virtual StatusCode | terminate () |
virtual StatusCode | start () |
virtual StatusCode | stop () |
virtual StatusCode | restart () |
virtual bool | isExecuted () const |
virtual void | setExecuted (bool state) |
virtual void | resetExecuted () |
virtual Gaudi::StateMachine::State | FSMState () const |
virtual Gaudi::StateMachine::State | targetFSMState () const |
virtual bool | isEnabled () const |
virtual bool | filterPassed () const |
virtual void | setFilterPassed (bool state) |
StatusCode | service (const std::string &name, T *&psvc, bool createIf=true) const |
StatusCode | service (const std::string &svcType, const std::string &svcName, T *&psvc) const |
void | setOutputLevel (int level) |
IAuditorSvc * | auditorSvc () const |
IChronoStatSvc * | chronoSvc () const |
IChronoStatSvc * | chronoStatService () const |
IDataProviderSvc * | detSvc () const |
IDataProviderSvc * | detDataService () const |
IConversionSvc * | detCnvSvc () const |
IConversionSvc * | detDataCnvService () const |
IDataProviderSvc * | eventSvc () const |
IDataProviderSvc * | evtSvc () const |
IDataProviderSvc * | eventDataService () const |
IConversionSvc * | eventCnvSvc () const |
IConversionSvc * | eventDataCnvService () const |
IHistogramSvc * | histoSvc () const |
IHistogramSvc * | histogramDataService () const |
IMessageSvc * | msgSvc () const |
IMessageSvc * | messageService () const |
INTupleSvc * | ntupleSvc () const |
INTupleSvc * | ntupleService () const |
IRndmGenSvc * | randSvc () const |
IToolSvc * | toolSvc () const |
IExceptionSvc * | exceptionSvc () const |
ISvcLocator * | serviceLocator () const |
ISvcLocator * | svcLoc () const |
StatusCode | createSubAlgorithm (const std::string &type, const std::string &name, Algorithm *&pSubAlg) |
std::vector< Algorithm * > * | subAlgorithms () const |
virtual StatusCode | setProperty (const std::string &s) |
virtual StatusCode | setProperty (const std::string &n, const std::string &v) |
StatusCode | setProperty (const std::string &name, const TYPE &value) |
virtual StatusCode | getProperty (Property *p) const |
virtual const Property & | getProperty (const std::string &name) const |
virtual StatusCode | getProperty (const std::string &n, std::string &v) const |
virtual const std::vector< Property * > & | getProperties () const |
StatusCode | setProperties () |
Property * | declareProperty (const std::string &name, T &property, const std::string &doc="none") const |
Property * | declareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="") const |
IMonitorSvc * | monitorSvc () const |
void | declareInfo (const std::string &name, const T &var, const std::string &desc) const |
void | declareInfo (const std::string &name, const std::string &format, const void *var, int size, const std::string &desc) const |
unsigned long | addRef () |
unsigned long | release () |
StatusCode | queryInterface (const InterfaceID &riid, void **) |
Static Public Member Functions | |
static const InterfaceID & | interfaceID () |
static const InterfaceID & | interfaceID () |
static const InterfaceID & | interfaceID () |
Public Attributes | |
SUCCESS | |
NO_INTERFACE | |
VERSMISMATCH | |
LAST_ERROR | |
Protected Member Functions | |
bool | isInitialized () const |
bool | isFinalized () const |
int | outputLevel () const |
IntegerProperty & | outputLevelProperty () |
void | initOutputLevel (Property &prop) |
Private Attributes | |
MsgStream | m_log |
ToolHandle< IVirtualTool > | m_privTool |
ToolHandle< IVirtualTool > | m_pubTool |
ToolHandleArray< IVirtualTool > | m_listOfPrivateTools |
ToolHandleArray< IVirtualTool > | m_listOfPublicTools |
std::vector< std::string > | m_strings |
double | m_double |
Definition at line 15 of file ConcreteAlgorithm.h.
ConcreteAlgorithm::ConcreteAlgorithm | ( | const std::string & | name, | |
ISvcLocator * | svcloc | |||
) |
ConcreteAlgorithm::~ConcreteAlgorithm | ( | ) | [virtual] |
StatusCode ConcreteAlgorithm::initialize | ( | ) | [virtual] |
Reimplemented from Algorithm.
Definition at line 24 of file ConcreteAlgorithm.cc.
00025 { 00026 m_log << MSG::INFO << "initialize()" << endreq; 00027 m_log.setLevel( outputLevel() ); 00028 00029 m_log << "Retrieving public tool " << m_pubTool.typeAndName() << endreq; 00030 if ( m_pubTool.retrieve().isFailure() ) { 00031 m_log << MSG::ERROR << "Failed to retreive " << m_pubTool << endreq; 00032 return StatusCode::FAILURE; 00033 } else { 00034 m_log << MSG::INFO << "Retrieved " << m_pubTool << endreq; 00035 } 00036 00037 m_log << "Retrieving private tool " << m_privTool.typeAndName() << endreq; 00038 if ( m_privTool.retrieve().isFailure() ) { 00039 m_log << MSG::ERROR << "Failed to retreive " << m_privTool << endreq; 00040 return StatusCode::FAILURE; 00041 } else { 00042 m_log << MSG::INFO << "Retrieved " << m_privTool << endreq; 00043 } 00044 00045 00046 // public 00047 m_log << MSG::INFO << "Retrieving public tool list" << endreq; 00048 if ( m_listOfPublicTools.retrieve().isFailure() ) { 00049 m_log << MSG::ERROR << "Failed to retreive " << m_listOfPublicTools << endreq; 00050 return StatusCode::FAILURE; 00051 } else { 00052 m_log << MSG::INFO << "Retrieved " << m_listOfPublicTools << endreq; 00053 } 00054 00055 // private 00056 m_log << MSG::INFO << "Retrieving private tool list" << endreq; 00057 if ( m_listOfPrivateTools.retrieve().isFailure() ) { 00058 m_log << MSG::ERROR << "Failed to retreive " << m_listOfPrivateTools << endreq; 00059 return StatusCode::FAILURE; 00060 } else { 00061 m_log << MSG::INFO << "Retrieved " << m_listOfPrivateTools << endreq; 00062 } 00063 00064 return StatusCode::SUCCESS; 00065 }
StatusCode ConcreteAlgorithm::reinitialize | ( | ) | [virtual] |
Reimplemented from Algorithm.
Definition at line 66 of file ConcreteAlgorithm.cc.
00067 { 00068 m_log << MSG::INFO << "reinitialize()" << endreq; 00069 return this->initialize(); 00070 }
StatusCode ConcreteAlgorithm::beginRun | ( | ) | [virtual] |
Reimplemented from Algorithm.
Definition at line 71 of file ConcreteAlgorithm.cc.
00072 { 00073 m_log << MSG::INFO << "beginRun()" << endreq; 00074 return StatusCode::SUCCESS; 00075 }
StatusCode ConcreteAlgorithm::execute | ( | ) | [virtual] |
Implements Algorithm.
Definition at line 76 of file ConcreteAlgorithm.cc.
00077 { 00078 m_log << MSG::INFO << "exectue()" << endreq; 00079 00080 static int count = 0; 00081 ++count; 00082 double value = -5 + count; 00083 00084 // make list of private tools do their work 00085 ToolHandleArray<IVirtualTool>::iterator itPriv = m_listOfPrivateTools.begin(), 00086 itPrivEnd = m_listOfPrivateTools.end(); 00087 for ( ; itPriv != itPrivEnd; ++itPriv ) { 00088 StatusCode sc = (*itPriv)->doSomething(value); 00089 if ( sc.isFailure() ) { 00090 m_log << MSG::ERROR << "tool " << (*itPriv).typeAndName() 00091 << " failed it's task ... stop!" << endreq; 00092 return sc; 00093 } 00094 m_log << MSG::INFO << "Public: value = " << value << endreq; 00095 } 00096 00097 // make list of tools do their work 00098 ToolHandleArray< IVirtualTool >::iterator itPub = m_listOfPublicTools.begin(), 00099 itPubEnd = m_listOfPublicTools.end(); 00100 for ( ; itPub != itPubEnd; ++itPub ) { 00101 StatusCode sc = (*itPub)->doSomething(value); 00102 if ( sc.isFailure() ) { 00103 m_log << MSG::ERROR << "tool " << (*itPub).typeAndName() << 00104 " failed it's task ... stop!" << endreq; 00105 return sc; 00106 } 00107 m_log << MSG::INFO << "Private: value = " << value << endreq; 00108 } 00109 return StatusCode::SUCCESS; 00110 }
StatusCode ConcreteAlgorithm::endRun | ( | ) | [virtual] |
Reimplemented from Algorithm.
Definition at line 111 of file ConcreteAlgorithm.cc.
00112 { 00113 m_log << MSG::INFO << "endRun()" << endreq; 00114 return StatusCode::SUCCESS; 00115 }
StatusCode ConcreteAlgorithm::finalize | ( | ) | [virtual] |
Reimplemented from Algorithm.
Definition at line 116 of file ConcreteAlgorithm.cc.
00117 { 00118 m_log << MSG::INFO << "finalize()" << endreq; 00119 return StatusCode::SUCCESS; 00120 }
StatusCode ConcreteAlgorithm::setProperty | ( | const Property & | p | ) | [virtual] |
Reimplemented from Algorithm.
Definition at line 122 of file ConcreteAlgorithm.cc.
00123 { 00124 string name = p.name(); 00125 00126 m_log << MSG::INFO << "ConcreateAlgorithm::setProperty("<<name<<")" << endreq; 00127 if (dynamic_cast<const GaudiHandleProperty*>(&p)) { 00128 m_log << "Got a GaudiHandleProperty" << endreq; 00129 } 00130 if (dynamic_cast<const GaudiHandleArrayProperty*>(&p)) { 00131 m_log << "Got a GaudiHandleArrayProperty" << endreq; 00132 const GaudiHandleArrayProperty& ghap = dynamic_cast<const GaudiHandleArrayProperty&>(p); 00133 const vector<string> tan = ghap.value().typesAndNames(); 00134 for (size_t ind=0; ind<tan.size(); ++ind) { 00135 m_log << "\n" << ind << ": " << tan[ind]; 00136 } 00137 m_log << endreq; 00138 } 00139 if (dynamic_cast<const PropertyWithValue<GaudiHandleArrayBase>*>(&p)) { 00140 m_log << "Got a PropertyWithValue<GaudiHandleArrayBase>" << endreq; 00141 } 00142 // This is what the tool lists are coming in as! 00143 if (dynamic_cast<const SimpleProperty<string>*>(&p)) { 00144 m_log << "Got a SimpleProperty<string>" << endreq; 00145 } 00146 00147 m_log << MSG::INFO << "Property::toString(): " << p.toString() << endreq; 00148 00149 m_log << MSG::INFO << "Now calling Algorithm::setProperty()" << endreq; 00150 return Algorithm::setProperty(p); 00151 }
MsgStream ConcreteAlgorithm::m_log [private] |
Definition at line 30 of file ConcreteAlgorithm.h.
ToolHandle<IVirtualTool> ConcreteAlgorithm::m_privTool [private] |
Definition at line 31 of file ConcreteAlgorithm.h.
ToolHandle<IVirtualTool> ConcreteAlgorithm::m_pubTool [private] |
Definition at line 31 of file ConcreteAlgorithm.h.
Definition at line 32 of file ConcreteAlgorithm.h.
Definition at line 33 of file ConcreteAlgorithm.h.
std::vector<std::string> ConcreteAlgorithm::m_strings [private] |
Definition at line 34 of file ConcreteAlgorithm.h.
double ConcreteAlgorithm::m_double [private] |
Definition at line 35 of file ConcreteAlgorithm.h.