List of all registered catalogs. More...
#include <BESCatalogList.h>
Public Types | |
typedef map< string, BESCatalog * >::const_iterator | catalog_citer |
typedef map< string, BESCatalog * >::iterator | catalog_iter |
Public Member Functions | |
virtual bool | add_catalog (BESCatalog *catalog) |
adds the speciifed catalog to the list | |
BESCatalogList () | |
construct a catalog list | |
virtual bool | deref_catalog (const string &catalog_name) |
de-reference the specified catalog and remove from list if no longer referenced | |
virtual void | dump (ostream &strm) const |
dumps information about this object | |
virtual BESCatalog * | find_catalog (const string &catalog_name) |
find the catalog in the list with the specified name | |
virtual bool | ref_catalog (const string &catalog_name) |
reference the specified catalog | |
virtual void | show_catalog (const string &container, const string &catalog_or_info, BESInfo *info) |
show the contents of the catalog given the specified container | |
virtual | ~BESCatalogList () |
list destructor deletes all registered catalogs | |
Static Public Member Functions | |
static BESCatalogList * | TheCatalogList () |
returns the singleton BESCatalogList instance |
List of all registered catalogs.
BESCatalog objecgts can be registered with this list. The BES allows for multiple catalogs. Most installations will have a single catalog registered.
Catalogs have a uniq name
If there is only one catalog then the display of the root will be the display of that catalogs root.
If there are more than one catalogs registered then the view of the root will display the list of catalogs registered. To view the contents of a specific catalog begin each container name with the name of the catalog followed by a colon.
show catalog for "cedar_catalog:/instrument/5340/year/2004/";
Definition at line 69 of file BESCatalogList.h.
typedef map<string,BESCatalog *>::const_iterator BESCatalogList::catalog_citer |
Definition at line 77 of file BESCatalogList.h.
typedef map<string,BESCatalog *>::iterator BESCatalogList::catalog_iter |
Definition at line 76 of file BESCatalogList.h.
BESCatalogList::BESCatalogList | ( | ) |
construct a catalog list
Definition at line 50 of file BESCatalogList.cc.
References BES_DEFAULT_CATALOG, BESKeys::get_key(), and TheBESKeys::TheKeys().
BESCatalogList::~BESCatalogList | ( | ) | [virtual] |
list destructor deletes all registered catalogs
Definition at line 65 of file BESCatalogList.cc.
bool BESCatalogList::add_catalog | ( | BESCatalog * | catalog | ) | [virtual] |
adds the speciifed catalog to the list
catalog | new catalog to add to the list |
Definition at line 84 of file BESCatalogList.cc.
References find_catalog(), and BESCatalog::get_catalog_name().
bool BESCatalogList::deref_catalog | ( | const string & | catalog_name | ) | [virtual] |
de-reference the specified catalog and remove from list if no longer referenced
Search the list for the catalog with the given name. If the catalog exists, de-reference it. If there are no more references then remove the catalog from the list and delete it.
catalog_name | name of the catalog to de-reference |
Definition at line 140 of file BESCatalogList.cc.
References BESCatalog::dereference_catalog().
void BESCatalogList::dump | ( | ostream & | strm | ) | const [virtual] |
dumps information about this object
Displays the pointer value of this instance along with the catalogs registered in this list.
strm | C++ i/o stream to dump the information to |
Implements BESObj.
Definition at line 307 of file BESCatalogList.cc.
References BESIndent::Indent(), BESIndent::LMarg(), and BESIndent::UnIndent().
BESCatalog * BESCatalogList::find_catalog | ( | const string & | catalog_name | ) | [virtual] |
find the catalog in the list with the specified name
catalog_name | name of the catalog to find |
Definition at line 166 of file BESCatalogList.cc.
Referenced by add_catalog().
bool BESCatalogList::ref_catalog | ( | const string & | catalog_name | ) | [virtual] |
reference the specified catalog
Search the list for the catalog with the given name. If the catalog exists, reference it and return true. If not found then return false.
catalog_name | name of the catalog to reference |
Definition at line 113 of file BESCatalogList.cc.
References BESCatalog::reference_catalog().
void BESCatalogList::show_catalog | ( | const string & | container, | |
const string & | coi, | |||
BESInfo * | info | |||
) | [virtual] |
show the contents of the catalog given the specified container
This method adds information about the specified container to the informational object specified.
If there is only one catalog registered then the container must be a node within that one catalog.
if there are more than one catalog registered then:
If coi is catalog then if the specified container is a collection then display the elements in the collection. If coi is info then display information about only the specified container and not its contents if a collection.
If there is a problem accessing the requested node then the reason for the problem must be included in the informational response, not an exception thrown. This method will not throw an exception.
container | node to display, empty means root | |
coi | is the request to include collections or just the specified container | |
info | informational object to add information to |
BESSyntaxUserError | if more than one catalog and no catalog specified; if the specified catalog does not exist; if the container within the catalog does not exist. |
Definition at line 211 of file BESCatalogList.cc.
References BESInfo::begin_tag(), BESInfo::end_tag(), BESCatalog::get_catalog_name(), BESCatalog::show_catalog(), and SHOW_INFO_RESPONSE.
Referenced by BESCatalogResponseHandler::execute().
BESCatalogList * BESCatalogList::TheCatalogList | ( | ) | [static] |
returns the singleton BESCatalogList instance
Definition at line 290 of file BESCatalogList.cc.
Referenced by BESCatalogResponseHandler::execute(), CSVModule::initialize(), and CSVModule::terminate().