33 #include "BESInfoList.h"
35 #include "TheBESKeys.h"
37 #define BES_DEFAULT_INFO_TYPE "txt"
41 BESInfoList::BESInfoList()
45 BESInfoList::~BESInfoList()
50 BESInfoList::add_info_builder(
const string &info_type,
51 p_info_builder info_builder )
53 BESInfoList::Info_citer i ;
54 i = _info_list.find( info_type ) ;
55 if( i == _info_list.end() )
57 _info_list[info_type] = info_builder ;
64 BESInfoList::rem_info_builder(
const string &info_type )
66 BESInfoList::Info_iter i ;
67 i = _info_list.find( info_type ) ;
68 if( i != _info_list.end() )
70 _info_list.erase( i ) ;
77 BESInfoList::build_info( )
79 string info_type =
"" ;
83 if( !found || info_type ==
"" )
84 info_type = BES_DEFAULT_INFO_TYPE ;
86 BESInfoList::Info_citer i ;
87 i = _info_list.find( info_type ) ;
88 if( i != _info_list.end() )
90 p_info_builder p = (*i).second ;
93 return p( info_type ) ;
109 strm << BESIndent::LMarg <<
"BESInfoList::dump - ("
110 << (
void *)
this <<
")" << endl ;
111 BESIndent::Indent() ;
112 if( _info_list.size() )
114 strm << BESIndent::LMarg <<
"registered builders:" << endl ;
115 BESIndent::Indent() ;
116 BESInfoList::Info_citer i = _info_list.begin() ;
117 BESInfoList::Info_citer ie = _info_list.end() ;
118 for( ; i != ie; i++ )
120 p_info_builder p = (*i).second ;
129 strm << BESIndent::LMarg <<
"builder is null" << endl ;
132 BESIndent::UnIndent() ;
136 strm << BESIndent::LMarg <<
"registered builders: none" << endl ;
138 BESIndent::UnIndent() ;
142 BESInfoList::TheList()