3 #ifndef GAUDISVC_FASTHISTORYSVC_H
16 #ifndef KERNEL_SVCFACTORY_H
19 #ifndef GAUDIKERNEL_ISVCLOCATOR_H
44 #define ON_DEBUG if (UNLIKELY(outputLevel() <= MSG::DEBUG))
45 #define ON_VERBOSE if (UNLIKELY(outputLevel() <= MSG::VERBOSE))
66 return (key < rhs.
key);
75 m_isInitialized(false),
81 m_log(msgSvc(), name ),
82 m_outputFileTypeXML(false)
119 (
const_cast<Algorithm*
> (algitr->first))->release();
128 (
const_cast<AlgTool*
> (atitr->first))->release();
129 delete atitr->second;
136 (
const_cast<IService*
> (svitr->first))->release();
137 delete svitr->second;
163 static const bool CREATEIF(
true);
186 const bool rethrow =
false;
187 const bool oneShot =
true;
209 if (
service(
"JobOptionsSvc",jo).isFailure()) {
211 <<
"Could not get jobOptionsSvc - "
212 <<
"not adding properties to JobHistory" <<
endmsg;
215 bool foundAppMgr(
false);
220 for (it=clients.
begin(); it!=clients.
end(); ++it) {
221 if (*it ==
"ApplicationMgr") {
225 for (itr=props->
begin(); itr != props->
end(); ++itr) {
232 if (
service(
"ApplicationMgr",ap).isFailure()) {
237 for (itr2=props.
begin(); itr2 != props.
end(); ++itr2) {
251 pp_cast<void>(&algMgr) );
260 for (itr=algs.
begin(); itr!=algs.
end(); ++itr) {
264 <<
" does not inherit from Algorithm. Not registering it."
281 (
const_cast<IAlgTool*
>(*itra))->addRef();
293 for (itrs=svcs.
begin(); itrs!=svcs.
end(); ++itrs) {
367 <<
" already registered with HistorySvc" <<
endmsg;
371 (
const_cast<Algorithm*
>(&alg))->addRef();
444 return ( itr2->second );
499 const AlgTool* alg = itr_a->first;
520 m_log <<
"Dumping properties for Job";
541 for (itrj=props.
begin(); itrj != props.
end(); ++itrj) {
547 ofs << std::endl <<
"SERVICES" <<
std::endl;
556 ofs << std::endl <<
"ALGORITHMS" <<
std::endl;
565 ofs << std::endl <<
"ALGTOOLS" <<
std::endl;
568 const AlgTool* alg = itr_a->first;
590 <<
"HistorySvc has been initialized" <<
endmsg;
614 <<
"Could not discover current Algorithm:" <<
endl
615 <<
" object CLID: " <<
id <<
" key: \"" << key
624 <<
"Could not extract concrete Algorithm:"
626 <<
" object CLID: " <<
id <<
" key: \"" << key
658 algName = ialg->
name();
695 return mitr.
first->second;
726 if ( svc.
name() ==
"HistoryStore" ) {
771 return ( itr->second );
852 <<
"\" to an AlgTool" <<
endmsg;
858 <<
" already registered in HistorySvc" <<
endmsg;
863 (
const_cast<AlgTool*
>(alg))->addRef();
937 return ( itr2->second );
963 <<
"Will try again at next BeginEvent incident" <<
endmsg;
980 ost <<
"<PROPERTY name=\"" << prop->
name()
998 ofs <<
"<?xml version=\"1.0\" ?> " <<
std::endl;
1009 for (itrj=props.
begin(); itrj != props.
end(); ++itrj) {
1012 const Property* prp = itrj->second;
1016 if (client != client_currently_open) {
1017 if(client_currently_open!=
"start") ofs <<
" </COMPONENT>" <<
endl;
1018 ofs <<
" <COMPONENT name=\""
1019 << client <<
"\" class=\"undefined\">" <<
std::endl;
1022 ofs << client <<
" ";
1027 client_currently_open = client;
1030 ofs <<
" </COMPONENT>" << endl;
1035 ofs <<
"</GLOBAL>" <<
endl <<
"<SERVICES>" <<
endl;
1042 const IService* svc = itr_s->first;
1049 ofs <<
"</SERVICES>" <<
endl <<
"<ALGORITHMS> " <<
endl;
1064 ofs <<
"</ALGORITHMS>" <<
endl <<
"<ALGTOOLS> " <<
endl;
1071 const AlgTool* alg = itr_a->first;
1078 ofs <<
"</ALGTOOLS>" <<
endl <<
"</SETUP>" <<
endl;
1094 if ( (is=dynamic_cast<const IService*>(in)) != 0) {
1100 }
else if ( (ia = dynamic_cast<const Algorithm*>(in)) != 0 ) {
1106 }
else if ( (it = dynamic_cast<const IAlgTool*>(in)) != 0 ) {
1114 <<
"Could not dcast interface to accepted History Obj type for "
1115 << in->
name() << endreq;
1119 if (hist == 0 || vhist == 0) {
1120 m_log <<
MSG::ERROR <<
"Could not dcast recognized object to HistoryObj or IVersHistoryObj. This should never happen."
1126 hist->
dump(ofs,
true);
1128 ofs <<
">> " << vhist->
name() <<
endl << *hist <<
endl;