39 #include "BESContextManager.h"
55 _context_list[name] = value;
65 _context_list.erase(name);
81 BESContextManager::Context_iter i;
82 i = _context_list.find(name);
83 if (i != _context_list.end()) {
101 string value = BESContextManager::TheManager()->
get_context(name, found);
102 if (!found || value.empty())
return 0;
106 int val = strtol(value.c_str(), &endptr, 10);
107 if (val == 0 && errno > 0) {
108 throw BESInternalError(
string(
"Error reading an integer value for the context '") + name +
"': " + strerror(errno),
122 std::map<string, string> props;
123 BESContextManager::Context_citer i = _context_list.begin();
124 BESContextManager::Context_citer e = _context_list.end();
125 for (; i != e; i++) {
129 props[
"name"] = name;
130 info.add_tag(
"context", value, &props);
143 strm << BESIndent::LMarg <<
"BESContextManager::dump - (" << (
void *)
this <<
")" << endl;
145 if (_context_list.size()) {
146 strm << BESIndent::LMarg <<
"current context:" << endl;
148 BESContextManager::Context_citer i = _context_list.begin();
149 BESContextManager::Context_citer ie = _context_list.end();
150 for (; i != ie; i++) {
151 strm << BESIndent::LMarg << (*i).first <<
": " << (*i).second << endl;
153 BESIndent::UnIndent();
156 strm << BESIndent::LMarg <<
"no context" << endl;
158 BESIndent::UnIndent();
162 BESContextManager::TheManager()
164 if (_instance == 0) {