33 #include "BESInfoList.h"
35 #include "TheBESKeys.h"
41 #define BES_DEFAULT_INFO_TYPE "txt"
45 BESInfoList::BESInfoList()
49 BESInfoList::~BESInfoList()
54 BESInfoList::add_info_builder(
const string &info_type,
55 p_info_builder info_builder )
57 BESInfoList::Info_citer i ;
58 i = _info_list.find( info_type ) ;
59 if( i == _info_list.end() )
61 _info_list[info_type] = info_builder ;
68 BESInfoList::rem_info_builder(
const string &info_type )
70 BESInfoList::Info_iter i ;
71 i = _info_list.find( info_type ) ;
72 if( i != _info_list.end() )
74 _info_list.erase( i ) ;
81 BESInfoList::build_info( )
83 string info_type =
"" ;
87 if( !found || info_type ==
"" )
88 info_type = BES_DEFAULT_INFO_TYPE ;
90 BESInfoList::Info_citer i ;
91 i = _info_list.find( info_type ) ;
92 if( i != _info_list.end() )
94 p_info_builder p = (*i).second ;
97 return p( info_type ) ;
113 strm << BESIndent::LMarg <<
"BESInfoList::dump - ("
114 << (
void *)
this <<
")" << endl ;
115 BESIndent::Indent() ;
116 if( _info_list.size() )
118 strm << BESIndent::LMarg <<
"registered builders:" << endl ;
119 BESIndent::Indent() ;
120 BESInfoList::Info_citer i = _info_list.begin() ;
121 BESInfoList::Info_citer ie = _info_list.end() ;
122 for( ; i != ie; i++ )
124 p_info_builder p = (*i).second ;
133 strm << BESIndent::LMarg <<
"builder is null" << endl ;
136 BESIndent::UnIndent() ;
140 strm << BESIndent::LMarg <<
"registered builders: none" << endl ;
142 BESIndent::UnIndent() ;
146 BESInfoList::TheList()