14 #include <boost/filesystem.hpp>
22 #define ON_DEBUG if (UNLIKELY(outputLevel() <= MSG::DEBUG))
23 #define ON_VERBOSE if (UNLIKELY(outputLevel() <= MSG::VERBOSE))
25 #define DEBMSG ON_DEBUG debug()
26 #define VERMSG ON_VERBOSE verbose()
40 os <<
"INVALID";
break;
89 if (
service(
"IncidentSvc", p_incSvc,
true).isFailure()) {
116 if ( 0 == iocomponent ) {
134 if ( 0 == iocomponent ) {
139 DEBMSG <<
"io_contains: c: " << ioname <<
" f: " << fname <<
endmsg;
151 <<
" has empty old filename" <<
endmsg;
173 if ( 0 == iocomponent ) {
175 <<
"io_register (component) received a NULL pointer !" <<
endmsg;
179 DEBMSG <<
"--> io_register(" << ioname <<
")" <<
endmsg;
182 DEBMSG <<
" registering IoComponent \"" << ioname <<
"\"" <<
endmsg;
188 <<
"] already registered @" << (
void*)itr->second << endmsg;
207 if ( 0 == iocomponent ) {
212 DEBMSG <<
"--> io_register(" << ioname <<
","
214 <<
"," << fname <<
")" <<
endmsg;
219 <<
"could not register component [" << iocomponent->
name() <<
"] "
220 <<
"with the I/O component manager !"
233 <<
" has already had file " << fname
234 <<
" registered with i/o mode " << iomode <<
endmsg;
238 <<
" has already had file " << fname
239 <<
" registered with a different i/o mode " << ioe.
m_iomode
240 <<
" - now trying " << iomode <<
endmsg;
249 bool from_eos = tmp_name.find(
"root:")==0;
250 IoComponentEntry ioc(fname,(from_eos?tmp_name:boost::filesystem::absolute(tmp_name).
string()),iomode);
265 if ( 0 == iocomponent ) {
272 m_log <<
MSG::DEBUG <<
"--> io_retrieve(" << ioname <<
"," << fname <<
")"
276 if (!
findComp(iocomponent,ofname,it)) {
277 DEBMSG <<
"could not find c: " << ioname <<
" old_f: " << ofname <<
endmsg;
286 if (it->second.m_oldfname == ofname) {
287 DEBMSG <<
"retrieving new name for the component " << iocomponent->
name()
288 <<
" old name: " << ofname
289 <<
", new name: " << it->second.m_newfname <<
endmsg;
290 fname = it->second.m_newfname;
296 DEBMSG <<
"Unexpected error! Unable to find entry in the dictionary corresponding to old filename: " << ofname <<
endmsg;
323 if ( !(*io)->io_reinit().isSuccess() ) {
326 <<
"]->io_reinit() !" <<
endmsg;
349 DEBMSG <<
"--> io_update(" << ioc->
name() <<
","
350 << old_fname <<
"," << new_fname <<
")" <<
endmsg;
357 if (it->second.m_oldfname == old_fname) {
358 DEBMSG <<
"updating " << ioc->
name() <<
" f: " << old_fname <<
" -> "
360 it->second.m_newfname = new_fname;
374 DEBMSG <<
"--> io_update(" << ioc->
name() <<
","
375 << work_dir <<
")" <<
endmsg;
382 switch(it->second.m_iomode) {
385 it->second.m_newfname = it->second.m_oldabspath;
391 if(oldPath.is_relative() &&
392 oldPath.filename()==oldPath.relative_path()) {
403 it->second.m_newfname = newfname.string();
407 it->second.m_newfname = it->second.m_oldabspath;
415 m_log <<
MSG::ERROR <<
"Unable to update IoComponent for the mode " << it->second.m_iomode <<
endmsg;
431 DEBMSG <<
"-->io_update_all for the directory " << work_dir <<
endmsg;
439 <<
"]->io_update() !" <<
endmsg;
469 if ( !(*io)->io_finalize().isSuccess() ) {
472 <<
"]->io_finalize() !" <<
endmsg;
494 if (itr->second.m_oldfname == f) {
542 ost <<
"Listing all IoComponents (" <<
m_cdict.
size() <<
"): " <<
endl;
544 ost <<
" " << it->first->name() <<
" " << it->second
576 DEBMSG <<
" could not find component \"" << fi->
source()
599 DEBMSG <<
" could not find component \"" << fi->
source()