43 using std::ostringstream ;
57 static pthread_once_t BESCatalogList_instance_control = PTHREAD_ONCE_INIT;
68 pthread_once(&BESCatalogList_instance_control, initialize_instance);
75 void BESCatalogList::initialize_instance() {
79 atexit(delete_instance);
87 void BESCatalogList::delete_instance() {
100 string key =
"BES.Catalog.Default";
106 if (!found || _default_catalog.empty()) {
118 BESCatalogList::~BESCatalogList()
125 if( catalog )
delete catalog ;
152 std::pair<const std::string, BESCatalog*> p =
153 std::make_pair( name, catalog ) ;
154 result = _catalogs.insert(p).second;
179 i = _catalogs.find( catalog_name ) ;
180 if( i != _catalogs.end() )
206 i = _catalogs.find( catalog_name ) ;
207 if( i != _catalogs.end() )
212 _catalogs.erase( i ) ;
231 i = _catalogs.find( catalog_name ) ;
232 if( i != _catalogs.end() )
290 << (
void *)
this <<
")" << endl ;
293 << _default_catalog << endl ;
294 if( _catalogs.size() )
#define SHOW_INFO_RESPONSE
virtual BESCatalog * find_catalog(const string &catalog_name)
find the catalog in the list with the specified name
virtual BESCatalogEntry * show_catalog(const string &container, const string &coi, BESCatalogEntry *entry)=0
virtual bool add_catalog(BESCatalog *catalog)
adds the speciifed catalog to the list
virtual unsigned int dereference_catalog()
virtual BESCatalogEntry * show_catalogs(BESDataHandlerInterface &dhi, BESCatalogEntry *entry, bool show_default=true)
show the list of catalogs
virtual bool ref_catalog(const string &catalog_name)
reference the specified catalog
List of all registered catalogs.
virtual void dump(ostream &strm) const
dumps information about this object
Abstract exception class for the BES with basic string message.
virtual string default_catalog()
virtual bool deref_catalog(const string &catalog_name)
de-reference the specified catalog and remove from list if no longer referenced
static ostream & LMarg(ostream &strm)
#define BES_DEFAULT_CATALOG
BESCatalogList()
construct a catalog list
abstract base class catalog object.
void get_value(const string &s, string &val, bool &found)
Retrieve the value of a given key, if set.
Structure storing information used by the BES to handle the request.
virtual void reference_catalog()
virtual string get_catalog_name()
static BESCatalogList * TheCatalogList()
returns the singleton BESCatalogList instance.
static BESKeys * TheKeys()
map< string, BESCatalog * >::iterator catalog_iter
map< string, BESCatalog * >::const_iterator catalog_citer