33 #include "BESDefinitionStorageVolatile.h" 34 #include "BESDefine.h" 37 BESDefinitionStorageVolatile::~BESDefinitionStorageVolatile()
52 i = _def_list.find( def_name ) ;
53 if( i != _def_list.end() )
73 _def_list[def_name] = d ;
92 i = _def_list.find( def_name ) ;
93 if( i != _def_list.end() )
96 _def_list.erase( i ) ;
110 while( _def_list.size() != 0 )
112 Define_iter di = _def_list.begin() ;
114 _def_list.erase( di ) ;
136 map<string,string> dprops ;
137 map<string,string> cprops ;
138 map<string,string> aprops ;
139 Define_citer di = _def_list.begin() ;
140 Define_citer de = _def_list.end() ;
141 for( ; di != de; di++ )
143 string def_name = (*di).first ;
147 dprops[
"name"] = def_name ;
148 info.begin_tag(
"definition", &dprops ) ;
150 BESDefine::containers_citer ci = def->first_container() ;
151 BESDefine::containers_citer ce = def->end_container() ;
152 for( ; ci != ce; ci++ )
155 string sym = (*ci)->get_symbolic_name() ;
156 cprops[
"name"] = sym ;
158 string real = (*ci)->get_real_name() ;
159 string type = (*ci)->get_container_type() ;
160 cprops[
"type"] = type ;
161 string con = (*ci)->get_constraint() ;
164 cprops[
"constraint"] = con ;
166 string attrs = (*ci)->get_attributes() ;
169 cprops[
"attributes"] = attrs ;
171 info.add_tag(
"container", real, &cprops ) ;
174 if( !def->get_agg_handler().empty() )
177 aprops[
"handler"] = def->get_agg_handler() ;
178 info.add_tag(
"aggregation", def->get_agg_cmd(), &aprops ) ;
181 info.end_tag(
"definition" ) ;
195 strm << BESIndent::LMarg <<
"BESDefinitionStorageVolatile::dump - (" 196 << (
void *)
this <<
")" << endl ;
197 BESIndent::Indent() ;
198 strm << BESIndent::LMarg <<
"name: " <<
get_name() << endl ;
199 if( _def_list.size() )
201 strm << BESIndent::LMarg <<
"definitions:" << endl ;
202 BESIndent::Indent() ;
203 Define_citer di = _def_list.begin() ;
204 Define_citer de = _def_list.end() ;
205 for( ; di != de; di++ )
207 (*di).second->dump( strm ) ;
209 BESIndent::UnIndent() ;
213 strm << BESIndent::LMarg <<
"definitions: none" << endl ;
215 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 defintions 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