bes Updated for version 3.20.13
|
List of all registered catalogs. More...
#include <BESCatalogList.h>
Public Types | |
typedef std::map< std::string, BESCatalog * >::const_iterator | catalog_citer |
typedef std::map< std::string, BESCatalog * >::iterator | catalog_iter |
Public Member Functions | |
virtual bool | add_catalog (BESCatalog *catalog) |
adds the specified catalog to the list | |
BESCatalogList () | |
construct a catalog list | |
virtual BESCatalog * | default_catalog () const |
The the default catalog. | |
virtual std::string | default_catalog_name () const |
The name of the default catalog. | |
virtual bool | deref_catalog (const std::string &catalog_name) |
virtual void | dump (std::ostream &strm) const |
dump the contents of this object to the specified ostream | |
virtual int | empty () const |
virtual catalog_citer | end_catalog () const |
Iterator to the last catalog. | |
virtual BESCatalog * | find_catalog (const std::string &catalog_name) const |
virtual catalog_citer | first_catalog () const |
Iterator to the first catalog. | |
virtual int | num_catalogs () const |
The number of non-default catalogs. | |
virtual bool | ref_catalog (const std::string &catalog_name) |
virtual BESCatalogEntry * | show_catalogs (BESCatalogEntry *entry, bool show_default=true) |
virtual | ~BESCatalogList () |
list destructor deletes all registered catalogs | |
Static Public Member Functions | |
static BESCatalogList * | TheCatalogList () |
Get the singleton BESCatalogList instance. | |
Friends | |
class | BESCatalogListTest |
List of all registered catalogs.
Catalogs are a way of organizing data into a tree. Every BES daemon has at least one catalog, the default catalog (confusingly named 'catalog.') In general, this is the daemon's local file system.
Multiple BESCatalog objects can be registered with this list. However, most installations have a single catalog registered (the default catalog) which provides access to files on the host computer's local file system.
Each catalog in the list must have a unique name.
The BESCatalogList class is a singleton. The catalogs (represented by specializations of the BESCatalog class) are held in a reference-counted list. Handlers typically try to add the catalog they use, and if that fails because the catalog is already in the list, they increment its reference. See add_catalog() and ref_catalog(). When the singleton's instance is deleted, so are all of the catalogs, regardless of their reference count.
Definition at line 84 of file BESCatalogList.h.
typedef std::map<std::string,BESCatalog*>::const_iterator BESCatalogList::catalog_citer |
Definition at line 103 of file BESCatalogList.h.
typedef std::map<std::string,BESCatalog*>::iterator BESCatalogList::catalog_iter |
Definition at line 102 of file BESCatalogList.h.
BESCatalogList::BESCatalogList | ( | ) |
|
virtual |
list destructor deletes all registered catalogs
Definition at line 138 of file BESCatalogList.cc.
|
virtual |
adds the specified catalog to the list
Add a catalog to the list of catalogs. If a catalog with the same name already exists, don't add the BESCatalog instance (the test is limited to the BESCatalog object's name) and signal that by returning false. If the catalog was added, return true.
catalog | New catalog to add to the list |
Definition at line 162 of file BESCatalogList.cc.
|
inlinevirtual |
The the default catalog.
Definition at line 118 of file BESCatalogList.h.
|
inlinevirtual |
The name of the default catalog.
Definition at line 116 of file BESCatalogList.h.
|
virtual |
dump the contents of this object to the specified ostream
This method is implemented by all derived classes to dump their contents, in other words, any state they might have, private variables, etc...
The inline function below can be used to dump the contents of an OPeNDAPObj object. For example, the object Animal is derived from BESObj. A user could do the following:
Animal *a = new dog( "Sparky" ) ; cout << a << endl ;
And the dump method for dog could display the name passed into the constructor, the (this) pointer of the object, etc...
strm | C++ i/o stream to dump the object to |
Implements BESObj.
|
inlinevirtual |
Definition at line 113 of file BESCatalogList.h.
|
inlinevirtual |
Iterator to the last catalog.
Definition at line 133 of file BESCatalogList.h.
|
inlinevirtual |
Iterator to the first catalog.
Definition at line 130 of file BESCatalogList.h.
|
inlinevirtual |
The number of non-default catalogs.
Definition at line 112 of file BESCatalogList.h.
|
static |
Get the singleton BESCatalogList instance.
This static method returns the instance of this singleton class. It uses the protected constructor below to read the name of the default catalog from the BES's configuration file, using the key "BES.Catalog.Default". If the key is not found or the key lookup fails for any reason, it uses the the value of BES_DEFAULT_CATALOG as defined in this class' header file (currently the confusing name "catalog").
The implementation will only build one instance of CatalogList and thereafter simple return that pointer.
For this code, the default catalog is implemented suing CatalogDirectory, which exposes the BES's local POSIX file system, rooted at a place set in the BES configuration file.
Definition at line 81 of file BESCatalogList.cc.
|
friend |
Definition at line 99 of file BESCatalogList.h.