14 #include <boost/filesystem.hpp>
21 #define ON_DEBUG if (UNLIKELY(outputLevel() <= MSG::DEBUG))
22 #define ON_VERBOSE if (UNLIKELY(outputLevel() <= MSG::VERBOSE))
24 #define DEBMSG ON_DEBUG debug()
25 #define VERMSG ON_VERBOSE verbose()
39 os <<
"INVALID";
break;
88 if (
service(
"IncidentSvc", p_incSvc,
true).isFailure()) {
115 if ( 0 == iocomponent ) {
133 if ( 0 == iocomponent ) {
138 DEBMSG <<
"io_contains: c: " << ioname <<
" f: " << fname <<
endmsg;
150 <<
" has empty old filename" <<
endmsg;
172 if ( 0 == iocomponent ) {
174 <<
"io_register (component) received a NULL pointer !" <<
endmsg;
178 DEBMSG <<
"--> io_register(" << ioname <<
")" <<
endmsg;
181 DEBMSG <<
" registering IoComponent \"" << ioname <<
"\"" <<
endmsg;
187 <<
"] already registered @" << (
void*)itr->second << endmsg;
206 if ( 0 == iocomponent ) {
211 DEBMSG <<
"--> io_register(" << ioname <<
","
213 <<
"," << fname <<
")" <<
endmsg;
218 <<
"could not register component [" << iocomponent->
name() <<
"] "
219 <<
"with the I/O component manager !"
232 <<
" has already had file " << fname
233 <<
" registered with i/o mode " << iomode <<
endmsg;
237 <<
" has already had file " << fname
238 <<
" registered with a different i/o mode " << ioe.
m_iomode
239 <<
" - now trying " << iomode <<
endmsg;
248 bool from_eos = tmp_name.find(
"root:")==0;
249 IoComponentEntry ioc(fname,(from_eos?tmp_name:boost::filesystem::absolute(tmp_name).
string()),iomode);
264 if ( 0 == iocomponent ) {
271 m_log <<
MSG::DEBUG <<
"--> io_retrieve(" << ioname <<
"," << fname <<
")"
275 if (!
findComp(iocomponent,ofname,it)) {
276 DEBMSG <<
"could not find c: " << ioname <<
" old_f: " << ofname <<
endmsg;
285 if (it->second.m_oldfname == ofname) {
286 DEBMSG <<
"retrieving new name for the component " << iocomponent->
name()
287 <<
" old name: " << ofname
288 <<
", new name: " << it->second.m_newfname <<
endmsg;
289 fname = it->second.m_newfname;
295 DEBMSG <<
"Unexpected error! Unable to find entry in the dictionary corresponding to old filename: " << ofname <<
endmsg;
322 if ( !(*io)->io_reinit().isSuccess() ) {
325 <<
"]->io_reinit() !" <<
endmsg;
348 DEBMSG <<
"--> io_update(" << ioc->
name() <<
","
349 << old_fname <<
"," << new_fname <<
")" <<
endmsg;
356 if (it->second.m_oldfname == old_fname) {
357 DEBMSG <<
"updating " << ioc->
name() <<
" f: " << old_fname <<
" -> "
359 it->second.m_newfname = new_fname;
373 DEBMSG <<
"--> io_update(" << ioc->
name() <<
","
374 << work_dir <<
")" <<
endmsg;
381 switch(it->second.m_iomode) {
384 it->second.m_newfname = it->second.m_oldabspath;
390 if(oldPath.is_relative() &&
391 oldPath.filename()==oldPath.relative_path()) {
402 it->second.m_newfname = newfname.string();
406 it->second.m_newfname = it->second.m_oldabspath;
414 m_log <<
MSG::ERROR <<
"Unable to update IoComponent for the mode " << it->second.m_iomode <<
endmsg;
430 DEBMSG <<
"-->io_update_all for the directory " << work_dir <<
endmsg;
438 <<
"]->io_update() !" <<
endmsg;
468 if ( !(*io)->io_finalize().isSuccess() ) {
471 <<
"]->io_finalize() !" <<
endmsg;
493 if (itr->second.m_oldfname == f) {
541 ost <<
"Listing all IoComponents (" <<
m_cdict.
size() <<
"): " <<
endl;
543 ost <<
" " << it->first->name() <<
" " << it->second
575 DEBMSG <<
" could not find component \"" << fi->
source()
598 DEBMSG <<
" could not find component \"" << fi->
source()