33 #include "BESReporterList.h"
34 #include "BESReporter.h"
38 BESReporterList::BESReporterList()
42 BESReporterList::~BESReporterList()
45 BESReporterList::Reporter_iter i = _reporter_list.begin() ;
46 for( ; i != _reporter_list.end(); i++ )
48 reporter = (*i).second ;
49 if( reporter ) {
delete reporter ; (*i).second = 0 ; }
53 _reporter_list.clear() ;
57 BESReporterList::add_reporter(
string reporter_name,
60 if( find_reporter( reporter_name ) == 0 )
62 _reporter_list[reporter_name] = reporter_object ;
69 BESReporterList::remove_reporter(
string reporter_name )
72 BESReporterList::Reporter_iter i ;
73 i = _reporter_list.find( reporter_name ) ;
74 if( i != _reporter_list.end() )
77 _reporter_list.erase( i ) ;
83 BESReporterList::find_reporter(
string reporter_name )
85 BESReporterList::Reporter_citer i ;
86 i = _reporter_list.find( reporter_name ) ;
87 if( i != _reporter_list.end() )
98 BESReporterList::Reporter_iter i = _reporter_list.begin() ;
99 for( ; i != _reporter_list.end(); i++ )
101 reporter = (*i).second ;
102 if( reporter ) reporter->report( dhi ) ;
116 strm << BESIndent::LMarg <<
"BESReporterList::dump - ("
117 << (
void *)
this <<
")" << endl ;
118 BESIndent::Indent() ;
119 if( _reporter_list.size() )
121 strm << BESIndent::LMarg <<
"registered reporters:" << endl ;
122 BESIndent::Indent() ;
123 BESReporterList::Reporter_citer i = _reporter_list.begin() ;
124 BESReporterList::Reporter_citer ie = _reporter_list.end() ;
125 for( ; i != ie; i++ )
127 strm << BESIndent::LMarg <<
"reporter: " << (*i).first << endl ;
128 BESIndent::Indent() ;
130 reporter->
dump( strm ) ;
131 BESIndent::UnIndent() ;
133 BESIndent::UnIndent() ;
137 strm << BESIndent::LMarg <<
"registered reporters: none" << endl ;
139 BESIndent::UnIndent() ;
143 BESReporterList::TheList()