33 #include "BESDefinitionStorageVolatile.h" 34 #include "BESDefine.h" 37 BESDefinitionStorageVolatile::~BESDefinitionStorageVolatile()
52 i = _def_list.find(def_name);
53 if (i != _def_list.end()) {
69 _def_list[def_name] = d;
87 i = _def_list.find(def_name);
88 if (i != _def_list.end()) {
103 while (_def_list.size() != 0) {
104 Define_iter di = _def_list.begin();
126 map<string, string> dprops;
127 map<string, string> cprops;
128 map<string, string> aprops;
129 Define_citer di = _def_list.begin();
130 Define_citer de = _def_list.end();
131 for (; di != de; di++) {
132 string def_name = (*di).first;
136 dprops[
"name"] = def_name;
137 info.begin_tag(
"definition", &dprops);
139 BESDefine::containers_citer ci = def->first_container();
140 BESDefine::containers_citer ce = def->end_container();
141 for (; ci != ce; ci++) {
144 string sym = (*ci)->get_symbolic_name();
145 cprops[
"name"] = sym;
148 string real = (*ci)->get_real_name();
150 string type = (*ci)->get_container_type();
151 cprops[
"type"] = type;
153 string con = (*ci)->get_constraint();
155 cprops[
"constraint"] = con;
158 string attrs = (*ci)->get_attributes();
159 if (!attrs.empty()) {
160 cprops[
"attributes"] = attrs;
163 info.add_tag(
"container", real, &cprops);
166 if (!def->get_agg_handler().empty()) {
168 aprops[
"handler"] = def->get_agg_handler();
169 info.add_tag(
"aggregation", def->get_agg_cmd(), &aprops);
172 info.end_tag(
"definition");
185 strm << BESIndent::LMarg <<
"BESDefinitionStorageVolatile::dump - (" << (
void *)
this <<
")" << endl;
187 strm << BESIndent::LMarg <<
"name: " <<
get_name() << endl;
188 if (_def_list.size()) {
189 strm << BESIndent::LMarg <<
"definitions:" << endl;
191 Define_citer di = _def_list.begin();
192 Define_citer de = _def_list.end();
193 for (; di != de; di++) {
194 (*di).second->dump(strm);
196 BESIndent::UnIndent();
199 strm << BESIndent::LMarg <<
"definitions: none" << endl;
201 BESIndent::UnIndent();
virtual bool add_definition(const string &def_name, BESDefine *d)
adds a given definition to this volatile storage
virtual void dump(ostream &strm) const
dumps information about this object
virtual BESDefine * look_for(const string &def_name)
looks for a definition in this volatile store with the given name
virtual bool del_definition(const string &def_name)
deletes a defintion with the given name from this volatile store
informational response object
virtual void show_definitions(BESInfo &info)
show the definitions stored in this store
virtual bool del_definitions()
deletes all defintions from the definition store
virtual const string & get_name() const
retrieve the name of this persistent store