43 using std::ostringstream;
53 static pthread_once_t BESCatalogList_instance_control = PTHREAD_ONCE_INIT;
62 pthread_once(&BESCatalogList_instance_control, initialize_instance);
69 void BESCatalogList::initialize_instance() {
73 atexit(delete_instance);
81 void BESCatalogList::delete_instance() {
92 string key =
"BES.Catalog.Default";
99 if (!found || _default_catalog.empty()) {
108 BESCatalogList::~BESCatalogList() {
111 for (; i != e; i++) {
113 if (catalog)
delete catalog;
132 std::pair<const std::string, BESCatalog*> p = std::make_pair(name, catalog);
133 result = _catalogs.insert(p).second;
156 i = _catalogs.find(catalog_name);
157 if (i != _catalogs.end()) {
180 i = _catalogs.find(catalog_name);
181 if (i != _catalogs.end()) {
202 i = _catalogs.find(catalog_name);
203 if (i != _catalogs.end()) {
229 for (; i != e; i++) {
250 strm <<
BESIndent::LMarg <<
"BESCatalogList::dump - (" << (
void *)
this <<
")" << endl;
252 strm <<
BESIndent::LMarg <<
"default catalog: " << _default_catalog << endl;
253 if (_catalogs.size()) {
258 for (; i != e; i++) {
#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