41#include "BESInfoList.h"
43#include "TheBESKeys.h"
49#define BES_DEFAULT_INFO_TYPE "txt"
52static std::once_flag d_euc_init_once;
54BESInfoList::~BESInfoList() {}
56BESInfoList::BESInfoList() {}
59BESInfoList::add_info_builder(
const string &info_type,
60 p_info_builder info_builder) {
62 std::lock_guard<std::recursive_mutex> lock_me(d_cache_lock_mutex);
64 BESInfoList::Info_citer i;
65 i = _info_list.find(info_type);
66 if (i == _info_list.end()) {
67 _info_list[info_type] = info_builder;
74BESInfoList::rem_info_builder(
const string &info_type) {
76 std::lock_guard<std::recursive_mutex> lock_me(d_cache_lock_mutex);
78 BESInfoList::Info_iter i;
79 i = _info_list.find(info_type);
80 if (i != _info_list.end()) {
88BESInfoList::build_info() {
90 std::lock_guard<std::recursive_mutex> lock_me(d_cache_lock_mutex);
92 string info_type =
"";
96 if (!found || info_type ==
"")
97 info_type = BES_DEFAULT_INFO_TYPE;
99 BESInfoList::Info_citer i;
100 i = _info_list.find(info_type);
101 if (i != _info_list.end()) {
102 p_info_builder p = (*i).second;
120 std::lock_guard<std::recursive_mutex> lock_me(d_cache_lock_mutex);
122 strm << BESIndent::LMarg <<
"BESInfoList::dump - ("
123 << (
void *)
this <<
")" << endl;
125 if (_info_list.size()) {
126 strm << BESIndent::LMarg <<
"registered builders:" << endl;
128 BESInfoList::Info_citer i = _info_list.begin();
129 BESInfoList::Info_citer ie = _info_list.end();
130 for (; i != ie; i++) {
131 p_info_builder p = (*i).second;
137 strm << BESIndent::LMarg <<
"builder is null" << endl;
140 BESIndent::UnIndent();
142 strm << BESIndent::LMarg <<
"registered builders: none" << endl;
144 BESIndent::UnIndent();
147void BESInfoList::initialize_instance() {
150 atexit(delete_instance);
154void BESInfoList::delete_instance() {
160BESInfoList::TheList() {
161 std::call_once(d_euc_init_once,BESInfoList::initialize_instance);
virtual void dump(std::ostream &strm) const
dumps information about this object
informational response object
virtual void dump(std::ostream &strm) const
Displays debug information about this object.
void get_value(const std::string &s, std::string &val, bool &found)
Retrieve the value of a given key, if set.
static TheBESKeys * TheKeys()