33 #include "BESReporterList.h"
34 #include "BESReporter.h"
42 BESReporterList::BESReporterList()
46 BESReporterList::~BESReporterList()
49 BESReporterList::Reporter_iter i = _reporter_list.begin() ;
50 for( ; i != _reporter_list.end(); i++ )
52 reporter = (*i).second ;
53 if( reporter ) {
delete reporter ; (*i).second = 0 ; }
57 _reporter_list.clear() ;
61 BESReporterList::add_reporter(
string reporter_name,
64 if( find_reporter( reporter_name ) == 0 )
66 _reporter_list[reporter_name] = reporter_object ;
73 BESReporterList::remove_reporter(
string reporter_name )
76 BESReporterList::Reporter_iter i ;
77 i = _reporter_list.find( reporter_name ) ;
78 if( i != _reporter_list.end() )
81 _reporter_list.erase( i ) ;
87 BESReporterList::find_reporter(
string reporter_name )
89 BESReporterList::Reporter_citer i ;
90 i = _reporter_list.find( reporter_name ) ;
91 if( i != _reporter_list.end() )
102 BESReporterList::Reporter_iter i = _reporter_list.begin() ;
103 for( ; i != _reporter_list.end(); i++ )
105 reporter = (*i).second ;
106 if( reporter ) reporter->report( dhi ) ;
120 strm << BESIndent::LMarg <<
"BESReporterList::dump - ("
121 << (
void *)
this <<
")" << endl ;
122 BESIndent::Indent() ;
123 if( _reporter_list.size() )
125 strm << BESIndent::LMarg <<
"registered reporters:" << endl ;
126 BESIndent::Indent() ;
127 BESReporterList::Reporter_citer i = _reporter_list.begin() ;
128 BESReporterList::Reporter_citer ie = _reporter_list.end() ;
129 for( ; i != ie; i++ )
131 strm << BESIndent::LMarg <<
"reporter: " << (*i).first << endl ;
132 BESIndent::Indent() ;
134 reporter->
dump( strm ) ;
135 BESIndent::UnIndent() ;
137 BESIndent::UnIndent() ;
141 strm << BESIndent::LMarg <<
"registered reporters: none" << endl ;
143 BESIndent::UnIndent() ;
147 BESReporterList::TheList()