39 #include "BESContextManager.h"
51 _context_list[name] = value;
61 _context_list.erase(name);
77 BESContextManager::Context_iter i;
78 i = _context_list.find(name);
79 if (i != _context_list.end()) {
97 string value = BESContextManager::TheManager()->
get_context(name, found);
98 if (!found || value.empty())
return 0;
102 int val = strtol(value.c_str(), &endptr, 10);
103 if (val == 0 && errno > 0) {
104 throw BESInternalError(
string(
"Error reading an integer value for the context '") + name +
"': " + strerror(errno),
118 map<string, string> props;
119 BESContextManager::Context_citer i = _context_list.begin();
120 BESContextManager::Context_citer e = _context_list.end();
121 for (; i != e; i++) {
125 props[
"name"] = name;
126 info.add_tag(
"context", value, &props);
139 strm << BESIndent::LMarg <<
"BESContextManager::dump - (" << (
void *)
this <<
")" << endl;
141 if (_context_list.size()) {
142 strm << BESIndent::LMarg <<
"current context:" << endl;
144 BESContextManager::Context_citer i = _context_list.begin();
145 BESContextManager::Context_citer ie = _context_list.end();
146 for (; i != ie; i++) {
147 strm << BESIndent::LMarg << (*i).first <<
": " << (*i).second << endl;
149 BESIndent::UnIndent();
152 strm << BESIndent::LMarg <<
"no context" << endl;
154 BESIndent::UnIndent();
158 BESContextManager::TheManager()
160 if (_instance == 0) {