1 #ifndef GAUDISVC_FASTHISTORYSVC_H
13 #ifndef KERNEL_SVCFACTORY_H
16 #ifndef GAUDIKERNEL_ISVCLOCATOR_H
60 return (key < rhs.
key);
69 m_isInitialized(false),
75 m_log(msgSvc(), name )
112 (
const_cast<Algorithm*
> (algitr->first))->release();
121 (
const_cast<AlgTool*
> (atitr->first))->release();
122 delete atitr->second;
129 (
const_cast<IService*
> (svitr->first))->release();
130 delete svitr->second;
157 static const bool CREATEIF(
true);
180 const bool rethrow =
false;
181 const bool oneShot =
true;
197 if (
service(
"JobOptionsSvc",jo).isFailure()) {
199 <<
"Could not get jobOptionsSvc - "
200 <<
"not adding properties to JobHistory" <<
endmsg;
203 bool foundAppMgr(
false);
208 for (it=clients.
begin(); it!=clients.
end(); ++it) {
209 if (*it ==
"ApplicationMgr") {
213 for (itr=props->
begin(); itr != props->
end(); ++itr) {
220 if (
service(
"ApplicationMgr",ap).isFailure()) {
225 for (itr2=props.
begin(); itr2 != props.
end(); ++itr2) {
239 pp_cast<void>(&algMgr) );
248 for (itr=algs.
begin(); itr!=algs.
end(); ++itr) {
252 <<
" does not inherit from Algorithm. Not registering it."
269 (
const_cast<IAlgTool*
>(*itra))->addRef();
281 for (itrs=svcs.
begin(); itrs!=svcs.
end(); ++itrs) {
352 <<
" already registered with HistorySvc" <<
endmsg;
356 (
const_cast<Algorithm*
>(&alg))->addRef();
429 return ( itr2->second );
483 const AlgTool* alg = itr_a->first;
504 m_log <<
"Dumping properties for Job";
525 for (itrj=props.
begin(); itrj != props.
end(); ++itrj) {
531 ofs << std::endl <<
"SERVICES" <<
std::endl;
540 ofs << std::endl <<
"ALGORITHMS" <<
std::endl;
549 ofs << std::endl <<
"ALGTOOLS" <<
std::endl;
552 const AlgTool* alg = itr_a->first;
574 <<
"HistorySvc has been initialized" <<
endmsg;
598 <<
"Could not discover current Algorithm:" <<
endl
599 <<
" object CLID: " <<
id <<
" key: \"" << key
609 <<
"Could not extract concerete Algorithm:"
611 <<
" object CLID: " <<
id <<
" key: \"" << key
643 algName = ialg->
name();
680 return mitr.
first->second;
711 if ( svc.
name() ==
"HistoryStore" ) {
756 return ( itr->second );
837 <<
"\" to an AlgTool" <<
endmsg;
843 <<
" already registered in HistorySvc" <<
endmsg;
848 (
const_cast<AlgTool*
>(alg))->addRef();
922 return ( itr2->second );
948 <<
"Will try again at next BeginEvent incident" <<
endmsg;
965 ost <<
"<PROPERTY name=\"" << prop->
name()
983 ofs <<
"<?xml version=\"1.0\" ?> " <<
std::endl;
994 for (itrj=props.
begin(); itrj != props.
end(); ++itrj) {
1001 if (client != client_currently_open) {
1002 if(client_currently_open!=
"start") ofs <<
" </COMPONENT>" <<
endl;
1003 ofs <<
" <COMPONENT name=\""
1004 << client <<
"\" class=\"undefined\">" <<
std::endl;
1007 ofs << client <<
" ";
1012 client_currently_open = client;
1016 ofs <<
" </COMPONENT>" <<
endl;
1019 ofs <<
"</GLOBAL>" << endl <<
"<SERVICES>" << endl;
1026 const IService* svc = itr_s->first;
1033 ofs <<
"</SERVICES>" << endl <<
"<ALGORITHMS> " << endl;
1048 ofs <<
"</ALGORITHMS>" << endl <<
"<ALGTOOLS> " << endl;
1055 const AlgTool* alg = itr_a->first;
1062 ofs <<
"</ALGTOOLS>" << endl <<
"</SETUP>" << endl;
1078 if ( (is=dynamic_cast<const IService*>(in)) != 0) {
1081 }
else if ( (ia = dynamic_cast<const Algorithm*>(in)) != 0 ) {
1084 }
else if ( (it = dynamic_cast<const IAlgTool*>(in)) != 0 ) {
1089 <<
"Could not dcast interface to accepted History Obj type for "
1094 if (hist == 0) {
return; }
1099 warning() <<
"Failed to dynamic cast IVersHistoryObj for " << in->
name() <<
endmsg;
1104 hist->
dump(ofs,
true);
1106 ofs <<
">> " << vhist->
name() <<
endl << *hist <<
endl;