33#include "BESDefinitionStorageVolatile.h"
41BESDefinitionStorageVolatile::~BESDefinitionStorageVolatile()
56 i = _def_list.find(def_name);
57 if (i != _def_list.end()) {
73 _def_list[def_name] = d;
91 i = _def_list.find(def_name);
92 if (i != _def_list.end()) {
107 while (_def_list.size() != 0) {
108 Define_iter di = _def_list.begin();
130 std::map<string, string> dprops;
131 std::map<string, string> cprops;
132 std::map<string, string> aprops;
133 Define_citer di = _def_list.begin();
134 Define_citer de = _def_list.end();
135 for (; di != de; di++) {
136 string def_name = (*di).first;
140 dprops[
"name"] = def_name;
141 info.begin_tag(
"definition", &dprops);
143 BESDefine::containers_citer ci = def->first_container();
144 BESDefine::containers_citer ce = def->end_container();
145 for (; ci != ce; ci++) {
148 string sym = (*ci)->get_symbolic_name();
149 cprops[
"name"] = sym;
152 string real = (*ci)->get_real_name();
154 string type = (*ci)->get_container_type();
155 cprops[
"type"] = type;
157 string con = (*ci)->get_constraint();
159 cprops[
"constraint"] = con;
162 string attrs = (*ci)->get_attributes();
163 if (!attrs.empty()) {
164 cprops[
"attributes"] = attrs;
167 info.add_tag(
"container", real, &cprops);
170 if (!def->get_agg_handler().empty()) {
172 aprops[
"handler"] = def->get_agg_handler();
173 info.add_tag(
"aggregation", def->get_agg_cmd(), &aprops);
176 info.end_tag(
"definition");
189 strm << BESIndent::LMarg <<
"BESDefinitionStorageVolatile::dump - (" << (
void *)
this <<
")" << endl;
191 strm << BESIndent::LMarg <<
"name: " <<
get_name() << endl;
192 if (_def_list.size()) {
193 strm << BESIndent::LMarg <<
"definitions:" << endl;
195 Define_citer di = _def_list.begin();
196 Define_citer de = _def_list.end();
197 for (; di != de; di++) {
198 (*di).second->dump(strm);
200 BESIndent::UnIndent();
203 strm << BESIndent::LMarg <<
"definitions: none" << endl;
205 BESIndent::UnIndent();
virtual void dump(std::ostream &strm) const
dumps information about this object
virtual void show_definitions(BESInfo &info)
show the definitions stored in this store
virtual BESDefine * look_for(const std::string &def_name)
looks for a definition in this volatile store with the given name
virtual bool del_definition(const std::string &def_name)
deletes a defintion with the given name from this volatile store
virtual bool add_definition(const std::string &def_name, BESDefine *d)
adds a given definition to this volatile storage
virtual bool del_definitions()
deletes all defintions from the definition store
virtual const std::string & get_name() const
retrieve the name of this persistent store
informational response object